]> Cypherpunks repositories - gostls13.git/commitdiff
spec: consistently use "element" rather than "value" for map entry values
authorRobert Griesemer <gri@golang.org>
Wed, 3 Jan 2018 18:33:11 +0000 (10:33 -0800)
committerRobert Griesemer <gri@golang.org>
Thu, 4 Jan 2018 20:17:19 +0000 (20:17 +0000)
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 <iant@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
doc/go_spec.html

index 9232eb0f8a80fb9658f7434fc393a6e9a5ece33b..bb76134248b1003ba7f1ee36f974be22371684fe 100644 (file)
@@ -1,6 +1,6 @@
 <!--{
        "Title": "The Go Programming Language Specification",
-       "Subtitle": "Version of December 21, 2017",
+       "Subtitle": "Version of January 3, 2018",
        "Path": "/ref/spec"
 }-->
 
@@ -1453,9 +1453,9 @@ components have identical types. In detail:
            <a href="#Exported_identifiers">Non-exported</a> method names from different
            packages are always different. The order of the methods is irrelevant.</li>
 
-       <li>Two map types are identical if they have identical key and value types.</li>
+       <li>Two map types are identical if they have identical key and element types.</li>
 
-       <li>Two channel types are identical if they have identical value types and
+       <li>Two channel types are identical if they have identical element types and
            the same direction.</li>
 </ul>
 
@@ -3033,11 +3033,11 @@ For <code>a</code> of <a href="#Map_types">map type</a> <code>M</code>:
            <a href="#Assignability">assignable</a>
            to the key type of <code>M</code></li>
        <li>if the map contains an entry with key <code>x</code>,
-           <code>a[x]</code> is the map value with key <code>x</code>
-           and the type of <code>a[x]</code> is the value type of <code>M</code></li>
+           <code>a[x]</code> is the map element with key <code>x</code>
+           and the type of <code>a[x]</code> is the element type of <code>M</code></li>
        <li>if the map is <code>nil</code> or does not contain such an entry,
            <code>a[x]</code> is the <a href="#The_zero_value">zero value</a>
-           for the value type of <code>M</code></li>
+           for the element type of <code>M</code></li>
 </ul>
 
 <p>
@@ -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)