]> Cypherpunks.ru repositories - gostls13.git/commitdiff
spec: explain eval order of binary operator examples with comments
authorRobert Griesemer <gri@golang.org>
Mon, 16 Oct 2023 16:08:51 +0000 (09:08 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 17 Oct 2023 15:06:48 +0000 (15:06 +0000)
Fixes #63525.

Change-Id: Ie9aa4dd47c025cd593e576c6e8de1774e1d1e302
Reviewed-on: https://go-review.googlesource.com/c/go/+/535775
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Bypass: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
doc/go_spec.html

index 09e2b6c97c5eeb69593802494ad4f8612892a252..38130a3cc9784519c5b46361c15d8eb244198741 100644 (file)
@@ -1,6 +1,6 @@
 <!--{
        "Title": "The Go Programming Language Specification",
-       "Subtitle": "Version of Sep 13, 2023",
+       "Subtitle": "Version of Oct 16, 2023",
        "Path": "/ref/spec"
 }-->
 
@@ -4826,12 +4826,13 @@ For instance, <code>x / y * z</code> is the same as <code>(x / y) * z</code>.
 </p>
 
 <pre>
-+x
-23 + 3*x[i]
-x &lt;= f()
-^a &gt;&gt; b
-f() || g()
-x == y+1 &amp;&amp; &lt;-chanInt &gt; 0
++x                         // x
+42 + a - b                 // (42 + a) - b
+23 + 3*x[i]                // 23 + (3 * x[i])
+x &lt;= f()                   // x &lt;= f()
+^a &gt;&gt; b                    // (^a) >> b
+f() || g()                 // f() || g()
+x == y+1 &amp;&amp; &lt;-chanInt &gt; 0  // (x == (y+1)) && ((<-chanInt) > 0)
 </pre>