On Wed, May 23, 2012 at 5:47 PM, Russ Cox <rsc@golang.org> wrote: > I think ...
14 years, 1 month ago
(2012-05-24 00:52:42 UTC)
#3
On Wed, May 23, 2012 at 5:47 PM, Russ Cox <rsc@golang.org> wrote:
> I think you mean "or a for statement's range clause". More than the
> range expression appears on the rhs.
"of a for statement's range clause" I buy. that's the rhs I care about
I stll disagree that the range expression of a for clause is a 'single multi-valued ...
14 years, 1 month ago
(2012-05-24 00:59:28 UTC)
#6
I stll disagree that the range expression of a for clause is a 'single
multi-valued expression'. Quoting elsewhere in the spec, 'The range
expression is evaluated once before beginning the loop'. The new text
overloads that phrase.
Maybe instead of trying to write text we should just leave it at the example?
Russ
On Thu, May 24, 2012 at 3:32 PM, Chris Wedgwood <cw@f00f.org> wrote: > Does that ...
14 years, 1 month 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
Issue 6246045: code review 6246045: spec: clarify evaluation order of "i, x[i] = range ..."
(Closed)
Created 14 years, 1 month ago by gri
Modified 14 years, 1 month ago
Reviewers: cw
Base URL:
Comments: 2