From 9c9e811bb34dc48abf256aae91af9199fb9f0f71 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Mon, 10 Dec 2012 11:55:57 -0800 Subject: [PATCH] spec: consistently use "indices" (rather than "indexes") We have been using all three terms "indices", "indexes", and "index expressions" indiscriminatly for index values. With this change, "index" refers to an index value, "indices" is the plural of "index", and "index expression" refers to an array, slice, or map indexed by an index: a[x]. R=r, rsc, iant, ken, mtj CC=golang-dev https://golang.org/cl/6912056 --- doc/go_spec.html | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/go_spec.html b/doc/go_spec.html index d72460da8e..6f4e68cc9b 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -791,8 +791,8 @@ The predeclared string type is string. The length of a string s (its size in bytes) can be discovered using the built-in function len. The length is a compile-time constant if the string is a constant. -A string's bytes can be accessed by integer indices 0 through -len(s)-1 (§Indexes). +A string's bytes can be accessed by integer indices +0 through len(s)-1. It is illegal to take the address of such an element; if s[i] is the i'th byte of a string, &s[i] is invalid. @@ -819,8 +819,8 @@ The length is part of the array's type and must be a constant expression that evaluates to a non-negative integer value. The length of array a can be discovered using the built-in function len. -The elements can be indexed by integer -indices 0 through len(a)-1 (§Indexes). +The elements can be addressed by integer indices +indices 0 through len(a)-1. Array types are always one-dimensional but may be composed to form multi-dimensional types.

@@ -850,8 +850,8 @@ SliceType = "[" "]" ElementType . Like arrays, slices are indexable and have a length. The length of a slice s can be discovered by the built-in function len; unlike with arrays it may change during -execution. The elements can be addressed by integer indices 0 -through len(s)-1 (§Indexes). The slice index of a +execution. The elements can be addressed by integer indices +0 through len(s)-1. The slice index of a given element may be less than the index of the same element in the underlying array.

@@ -1257,7 +1257,7 @@ For a map m, it can be discovered using the built-in function len and may change during execution. Elements may be added during execution using assignments and retrieved with -index expressions; they may be removed with the +index expressions; they may be removed with the delete built-in function.

@@ -2120,7 +2120,7 @@ The types of the expressions must be assignable to the respective field, element, and key types of the LiteralType; there is no additional conversion. The key is interpreted as a field name for struct literals, -an index expression for array and slice literals, and a key for map literals. +an index for array and slice literals, and a key for map literals. For map literals, all elements must have a key. It is an error to specify multiple elements with the same field name or constant key value. @@ -2480,7 +2480,7 @@ TODO: Specify what happens to receivers. --> -

Indexes

+

Index expressions

A primary expression of the form @@ -2596,7 +2596,7 @@ a[low : high]

-constructs a substring or slice. The index expressions low and +constructs a substring or slice. The indices low and high select which elements appear in the result. The result has indices starting at 0 and length equal to high - low. @@ -2619,7 +2619,7 @@ s[2] == 4

-For convenience, any of the index expressions may be omitted. A missing low +For convenience, any of the indices may be omitted. A missing low index defaults to zero; a missing high index defaults to the length of the sliced operand:

@@ -4010,7 +4010,7 @@ operand on the left.

The assignment proceeds in two phases. -First, the operands of index expressions +First, the operands of index expressions and pointer indirections (including implicit pointer indirections in selectors) on the left and the expressions on the right are all -- 2.48.1