1
0
mirror of https://github.com/golang/go synced 2024-11-25 11:57:58 -07:00

slight refinement of select: evaluation is top to bottom, as in switches.

DELTA=9  (2 added, 4 deleted, 3 changed)
OCL=34690
CL=34692
This commit is contained in:
Rob Pike 2009-09-16 11:49:35 -07:00
parent 5eb36240b7
commit 9d7538b42b

View File

@ -3609,9 +3609,10 @@ RecvExpr = [ Expression ( "=" | ":=" ) ] "<-" Expression .
<p> <p>
For all the send and receive expressions in the "select" For all the send and receive expressions in the "select"
statement, the channel expression is evaluated. Any expressions statement, the channel expressions are evaluated, along with
that appear on the right hand side of send expressions are also any expressions that appear on the right hand side of send expressions,
evaluated. If any of the resulting channels can proceed, one is in top-to-bottom order.
If any of the resulting operations can proceed, one is
chosen and the corresponding communication and statements are chosen and the corresponding communication and statements are
evaluated. Otherwise, if there is a default case, that executes; evaluated. Otherwise, if there is a default case, that executes;
if not, the statement blocks until one of the communications can if not, the statement blocks until one of the communications can
@ -3654,10 +3655,6 @@ for { // send random sequence of bits to c
} }
</pre> </pre>
<font color=red>
TODO: Make semantics more precise.
</font>
<h3 id="Return_statements">Return statements</h3> <h3 id="Return_statements">Return statements</h3>
@ -4489,6 +4486,7 @@ The following minimal alignment properties are guaranteed:
<ul> <ul>
<li><font color=red>Implementation does not honor the restriction on goto statements and targets (no intervening declarations).</font></li> <li><font color=red>Implementation does not honor the restriction on goto statements and targets (no intervening declarations).</font></li>
<li><font color=red>Gccgo does not implement the blank identifier.</font></li> <li><font color=red>Gccgo does not implement the blank identifier.</font></li>
<li><font color=red>Method expressions are not implemented.</font></li>
</ul> </ul>
</div> </div>