From bdac989ef7f7f3223d8dd4928dee3da595260f47 Mon Sep 17 00:00:00 2001 From: Shenghou Ma Date: Tue, 11 Jun 2013 02:52:07 +0800 Subject: [PATCH] doc/go_spec: more examples for unspecified cases of the evaluation order R=golang-dev, bradfitz, gri, iant, rsc CC=golang-dev https://golang.org/cl/7235044 --- doc/go_spec.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/go_spec.html b/doc/go_spec.html index 09bbb85f68..1e45e73d48 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -3929,8 +3929,10 @@ of y is not specified.
 a := 1
-f := func() int { a = 2; return 3 }
-x := []int{a, f()}  // x may be [1, 3] or [2, 3]: evaluation order between a and f() is not specified
+f := func() int { a++; return a }
+x := []int{a, f()} // x may be [1, 2] or [2, 2]: evaluation order between a and f() is not specified
+m := map[int]int{a: 1, a: 2} // m may be {2: 1} or {2: 2}: evaluation order between the two map assignments is not specified
+m2 := map[int]int{a: f()} // m2 may be {2: 3} or {3: 3}: evaluation order between the key and the value is not specified
 

-- 2.48.1