aboutsummaryrefslogtreecommitdiff
path: root/doc/go_spec.html
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2018-01-03 10:33:11 -0800
committerRobert Griesemer <gri@golang.org>2018-01-04 20:17:19 +0000
commit4de1d1d5cde4424d9361be516e4db4d7e76dd1f3 (patch)
tree0714c6df714a5b8d420436f54901f61615a57ffe /doc/go_spec.html
parent3f150934e274f9ce167e1ed565fb3e60b8ea8223 (diff)
downloadgo-4de1d1d5cde4424d9361be516e4db4d7e76dd1f3.tar.gz
go-4de1d1d5cde4424d9361be516e4db4d7e76dd1f3.zip
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 <iant@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Rob Pike <r@golang.org>
Diffstat (limited to 'doc/go_spec.html')
-rw-r--r--doc/go_spec.html14
1 files changed, 7 insertions, 7 deletions
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 @@
<!--{
"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)