From: Robert Griesemer Date: Wed, 3 Jan 2018 18:33:11 +0000 (-0800) Subject: spec: consistently use "element" rather than "value" for map entry values X-Git-Tag: go1.10beta2~52 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=4de1d1d5cde4424d9361be516e4db4d7e76dd1f3;p=gostls13.git spec: consistently use "element" rather than "value" for map entry values The spec refers to a map's key and element types; thus the respective values are "keys" and "elements". Also, a map value is the value of the entire map. Similar fix for channels, where appropriate. Fixes #23254. Change-Id: I6f03ea6d86586c7b0b3e84f0c2e9446b8109fa53 Reviewed-on: https://go-review.googlesource.com/85999 Reviewed-by: Ian Lance Taylor Reviewed-by: Matthew Dempsky Reviewed-by: Russ Cox Reviewed-by: Rob Pike --- diff --git a/doc/go_spec.html b/doc/go_spec.html index 9232eb0f8a..bb76134248 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -1453,9 +1453,9 @@ components have identical types. In detail: Non-exported method names from different packages are always different. The order of the methods is irrelevant. -
  • Two map types are identical if they have identical key and value types.
  • +
  • Two map types are identical if they have identical key and element types.
  • -
  • Two channel types are identical if they have identical value types and +
  • Two channel types are identical if they have identical element types and the same direction.
  • @@ -3033,11 +3033,11 @@ For a of map type M: assignable to the key type of M
  • if the map contains an entry with key x, - a[x] is the map value with key x - and the type of a[x] is the value type of M
  • + a[x] is the map element with key x + and the type of a[x] is the element type of M
  • if the map is nil or does not contain such an entry, a[x] is the zero value - for the value type of M
  • + for the element type of M

    @@ -5122,7 +5122,7 @@ for i, s := range a { } var key string -var val interface {} // value type of m is assignable to val +var val interface {} // element type of m is assignable to val m := map[string]int{"mon":0, "tue":1, "wed":2, "thu":3, "fri":4, "sat":5, "sun":6} for key, val = range m { h(key, val)