Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
4f18549c
Commit
4f18549c
authored
May 01, 2009
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clarifying ambiguity of evaluation order
R=r DELTA=16 (0 added, 3 deleted, 13 changed) OCL=28133 CL=28178
parent
eac5db7f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
12 deletions
+9
-12
doc/go_spec.html
doc/go_spec.html
+9
-12
No files found.
doc/go_spec.html
View file @
4f18549c
...
...
@@ -2905,21 +2905,18 @@ order. Otherwise, the order of evaluation is unspecified.
</p>
<p>
For example, while evaluating the arguments for this call
to function
<code>
f
</code>
,
For example, in the assignment
</p>
<pre>
f(g(), h() + x[i()],
<-c
)
y[f()], ok = g(h(), i() + x[j()],
<-c
),
k
(
)
</
pre
>
<p>
the call to
<code>
g()
</code>
happens before the call to
<code>
h()
</code>
,
which happens before the call to
<code>
i()
</code>
, all of
of which happen before receiving the value from the channel
<code>
c
</code>
.
However, the order of those events compared to the evaluation of
<code>
f
</code>
, the evaluation of
<code>
x
</code>
, and the indexing
of
<code>
x
</code>
by the return value of
<code>
i()
</code>
is not specified.
the function calls and communication happen in the order
<code>
f()
</code>
,
<code>
h()
</code>
,
<code>
i()
</code>
,
<code>
j()
</code>
,
<code><-c
</
code
>
,
<code>
g()
</code>
, and
<code>
k()
</code>
.
However, the order of those events compared to the evaluation
and indexing of
<code>
x
</code>
and the evaluation
of
<code>
y
</code>
is not specified.
</p>
<hr/>
...
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment