From: Robert Griesemer
Date: Sat, 2 May 2009 00:00:16 +0000 (-0700)
Subject: clarifying ambiguity of evaluation order
X-Git-Tag: weekly.2009-11-06~1728
X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=4f18549c0223ac6ea96f008a58cb2e2f5e61102d;p=gostls13.git
clarifying ambiguity of evaluation order
R=r
DELTA=16 (0 added, 3 deleted, 13 changed)
OCL=28133
CL=28178
---
diff --git a/doc/go_spec.html b/doc/go_spec.html
index 3517834463..d52d050cd8 100644
--- a/doc/go_spec.html
+++ b/doc/go_spec.html
@@ -2905,21 +2905,18 @@ order. Otherwise, the order of evaluation is unspecified.
-For example, while evaluating the arguments for this call
-to function f
,
+For example, in the assignment
-f(g(), h() + x[i()], <-c)
+y[f()], ok = g(h(), i() + x[j()], <-c), k()
-the call to g()
happens before the call to h()
,
-which happens before the call to i()
, all of
-of which happen before receiving the value from the channel
-c
.
-However, the order of those events compared to the evaluation of
-f
, the evaluation of x
, and the indexing
-of x
by the return value of
-i()
is not specified.
+the function calls and communication happen in the order
+f()
, h()
, i()
, j()
,
+<-c
, g()
, and k()
.
+However, the order of those events compared to the evaluation
+and indexing of x
and the evaluation
+of y
is not specified.
@@ -3164,7 +3161,7 @@ type of a specially annotated switch expression.
In an expression switch,
the switch expression is evaluated and
the case expressions, which need not be constants,
-are evaluated top-to-bottom; the first one that equals the
+are evaluated left-to-right and top-to-bottom; the first one that equals the
switch expression
triggers execution of the statements of the associated case;
the other cases are skipped.