From 4f18549c0223ac6ea96f008a58cb2e2f5e61102d Mon Sep 17 00:00:00 2001
From: Robert Griesemer
Date: Fri, 1 May 2009 17:00:16 -0700
Subject: [PATCH] clarifying ambiguity of evaluation order
R=r
DELTA=16 (0 added, 3 deleted, 13 changed)
OCL=28133
CL=28178
---
doc/go_spec.html | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
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.
--
2.52.0