From 3906706297a78df69d7f87748963bf375b4c4511 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Wed, 12 Dec 2012 11:06:26 -0800 Subject: [PATCH] spec: index and array/slice size constants must fit into an int R=r, rsc, iant, ken CC=golang-dev https://golang.org/cl/6903048 --- doc/go_spec.html | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/doc/go_spec.html b/doc/go_spec.html index 6e88d47f31..468fb3ad28 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -815,12 +815,13 @@ ElementType = Type .

-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 +The length is part of the array's type; it must evaluate to a non- +negative constant representable by a value +of type int. +The length of array a can be discovered using the built-in function len. The elements can be addressed by integer indices -indices 0 through len(a)-1. +0 through len(a)-1. Array types are always one-dimensional but may be composed to form multi-dimensional types.

@@ -2497,13 +2498,21 @@ The value x is called the rules apply:

+

+If a is not a map: +

+ +

For a of type A or *A where A is an array type: