Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(459)

Issue 6246045: code review 6246045: spec: clarify evaluation order of "i, x[i] = range ..." (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 9 months ago by gri
Modified:
12 years, 9 months ago
Reviewers:
cw
CC:
golang-dev, rsc, aam, iant, r
Visibility:
Public.

Description

spec: clarify evaluation order of "i, x[i] = range ..." Part of fix for issue 3464.

Patch Set 1 #

Patch Set 2 : diff -r 0dc36a693538 https://code.google.com/p/go #

Patch Set 3 : diff -r 0dc36a693538 https://code.google.com/p/go #

Patch Set 4 : diff -r 0dc36a693538 https://code.google.com/p/go #

Patch Set 5 : diff -r 0dc36a693538 https://code.google.com/p/go #

Patch Set 6 : diff -r 0dc36a693538 https://code.google.com/p/go #

Patch Set 7 : diff -r 0dc36a693538 https://code.google.com/p/go #

Patch Set 8 : diff -r 0dc36a693538 https://code.google.com/p/go #

Patch Set 9 : diff -r 0dc36a693538 https://code.google.com/p/go #

Total comments: 2

Patch Set 10 : diff -r dc9e8cac5622 https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -3 lines) Patch
M doc/go_spec.html View 1 2 3 4 5 6 7 8 9 3 chunks +14 lines, -3 lines 0 comments Download

Messages

Total messages: 15
gri
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go
12 years, 9 months ago (2012-05-24 00:46:14 UTC) #1
rsc
I think you mean "or a for statement's range clause". More than the range expression ...
12 years, 9 months ago (2012-05-24 00:47:26 UTC) #2
gri
On Wed, May 23, 2012 at 5:47 PM, Russ Cox <rsc@golang.org> wrote: > I think ...
12 years, 9 months ago (2012-05-24 00:52:42 UTC) #3
gri
Hello golang-dev@googlegroups.com, rsc@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
12 years, 9 months ago (2012-05-24 00:55:14 UTC) #4
rsc
the "or" is just part of the sentence, because it's the last of a long ...
12 years, 9 months ago (2012-05-24 00:55:31 UTC) #5
rsc
I stll disagree that the range expression of a for clause is a 'single multi-valued ...
12 years, 9 months ago (2012-05-24 00:59:28 UTC) #6
gri
Hello golang-dev@googlegroups.com, rsc@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
12 years, 9 months ago (2012-05-24 01:05:33 UTC) #7
rsc
LGTM Sorry for being pedantic.
12 years, 9 months ago (2012-05-24 01:07:06 UTC) #8
aam
Sorry this is off-topic, but don't you mean "Version of May 24, 2012"?
12 years, 9 months ago (2012-05-24 01:07:15 UTC) #9
iant
LGTM http://codereview.appspot.com/6246045/diff/15001/doc/go_spec.html File doc/go_spec.html (right): http://codereview.appspot.com/6246045/diff/15001/doc/go_spec.html#newcode3 doc/go_spec.html:3: "Subtitle": "Version of March 24, 2012", s/March/May/
12 years, 9 months ago (2012-05-24 03:37:20 UTC) #10
r
LGTM http://codereview.appspot.com/6246045/diff/15001/doc/go_spec.html File doc/go_spec.html (right): http://codereview.appspot.com/6246045/diff/15001/doc/go_spec.html#newcode3905 doc/go_spec.html:3905: // so i == 0, x == []int{3, ...
12 years, 9 months ago (2012-05-24 03:43:03 UTC) #11
r
s/==0/== 0/ of course
12 years, 9 months ago (2012-05-24 03:43:38 UTC) #12
gri
*** Submitted as http://code.google.com/p/go/source/detail?r=1c4d1ba268ca *** spec: clarify evaluation order of "i, x[i] = range ..." ...
12 years, 9 months ago (2012-05-24 17:59:52 UTC) #13
cw
Does that also clarify: x := []int{1, 0} x[x[0]], x[x[1]] = 5, 6
12 years, 9 months ago (2012-05-24 22:32:49 UTC) #14
gri
12 years, 9 months ago (2012-05-24 23:01:05 UTC) #15
On Thu, May 24, 2012 at 3:32 PM, Chris Wedgwood <cw@f00f.org> wrote:
> Does that also clarify:
>
>        x := []int{1, 0}
>
>        x[x[0]], x[x[1]] = 5, 6

This case was not disputed here. All indices are evaluated before any
assignments are happening. The result is well-defined (x == []int{6,
5} afterwards).
- gri
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b