mirror of
https://github.com/golang/go
synced 2024-11-26 05:27:57 -07:00
spec: explain eval order of binary operator examples with comments
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>
This commit is contained in:
parent
5873bd1d7e
commit
aa05674b1d
@ -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 <= f()
|
||||
^a >> b
|
||||
f() || g()
|
||||
x == y+1 && <-chanInt > 0
|
||||
+x // x
|
||||
42 + a - b // (42 + a) - b
|
||||
23 + 3*x[i] // 23 + (3 * x[i])
|
||||
x <= f() // x <= f()
|
||||
^a >> b // (^a) >> b
|
||||
f() || g() // f() || g()
|
||||
x == y+1 && <-chanInt > 0 // (x == (y+1)) && ((<-chanInt) > 0)
|
||||
</pre>
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user