From 462a17e0f3ac22174cba34dbfb488695f4ddfcd0 Mon Sep 17 00:00:00 2001
From: Robert Griesemer
A type determines the set of values and operations specific to values of that
type. A type may be specified by a
-(possibly qualified) type name
-(§Type declarations) or a type literal,
+(possibly qualified)
+type name or a type literal,
which composes a new type from previously declared types.
xxx
statement
- fix/remove unnecessary links
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7821050
---
doc/go_spec.html | 83 ++++++++++++++++++++++++------------------------
1 file changed, 42 insertions(+), 41 deletions(-)
diff --git a/doc/go_spec.html b/doc/go_spec.html
index 2136d8bbe8..881d166566 100644
--- a/doc/go_spec.html
+++ b/doc/go_spec.html
@@ -639,8 +639,8 @@ expressions.
a
can be discovered using the
built-in function cap(a)
.
-The comparison operators ==
and !=
-(§Comparison operators) must be fully defined
+The comparison operators
+==
and !=
must be fully defined
for operands of the key type; thus the key type must not be a function, map, or
slice.
If the key type is an interface type, these
@@ -1571,8 +1571,9 @@ declarations.
Labels are declared by labeled statements and are
-used in the break
, continue
, and goto
-statements (§Break statements, §Continue statements, §Goto statements).
+used in the "break",
+"continue", and
+"goto" statements.
It is illegal to define a label that is never used.
In contrast to other identifiers, labels are not block scoped and do
not conflict with identifiers that are not labels. The scope of a label
@@ -1872,7 +1873,7 @@ var _, found = entries[name] // map lookup; only interested in "found"
If a list of expressions is given, the variables are initialized -by assigning the expressions to the variables (§Assignments) +by assigning the expressions to the variables in order; all expressions must be consumed and all variables initialized from them. Otherwise, each variable is initialized to its zero value.
@@ -1939,9 +1940,11 @@ a, a := 1, 2 // illegal: double declaration of a or
Short variable declarations may appear only inside functions.
-In some contexts such as the initializers for if
,
-for
, or switch
statements,
-they can be used to declare local temporary variables (§Statements).
+In some contexts such as the initializers for
+"if",
+"for", or
+"switch" statements,
+they can be used to declare local temporary variables.
-Taking the address of a composite literal (§Address operators) +Taking the address of a composite literal generates a pointer to a unique instance of the literal's value.
@@ -3109,8 +3112,8 @@ occurs is implementation-specific. For unsigned integer values, the operations+
,-
,*
, and<<
are computed modulo 2n, where n is the bit width of -the unsigned integer's type -(§Numeric types). Loosely speaking, these unsigned integer operations +the unsigned integer's type. +Loosely speaking, these unsigned integer operations discard high bits upon overflow, and programs may rely on ``wrap around''.@@ -3187,8 +3190,8 @@ These terms and the result of the comparisons are defined as follows:
make
- (§Making slices, maps, and channels)
+ Two channel values are equal if they were created by the same call to
+ make
or if both have value nil
.
T
in any of these cases:
x
is an integer constant and T
is a
string type.
- The same rule as for non-constant x
applies in this case
- (§Conversions to and from a string type).
+ The same rule
+ as for non-constant x
applies in this case.
-The type in a case may be nil
-(§Predeclared identifiers);
+The type in a case may be nil
;
that case is used when the expression in the TypeSwitchGuard
is a nil
interface value.
-Regardless of how they are declared, all the result values are initialized to the zero -values for their type (§The zero value) upon entry to the +Regardless of how they are declared, all the result values are initialized to +the zero values for their type upon entry to the function. A "return" statement that specifies results sets the result parameters before any deferred functions are executed.
@@ -4910,7 +4912,9 @@ TODO: Define when return is required.A "break" statement terminates execution of the innermost -"for", "switch" or "select" statement. +"for", +"switch", or +"select" statement.
@@ -4919,10 +4923,8 @@ BreakStmt = "break" [ Label ] .If there is a label, it must be that of an enclosing -"for", "switch" or "select" statement, and that is the one whose execution -terminates -(§For statements, §Switch statements, -§Select statements). +"for", "switch", or "select" statement, +and that is the one whose execution terminates.
@@ -4939,7 +4941,7 @@ L:A "continue" statement begins the next iteration of the -innermost "for" loop at its post statement (§For statements). +innermost "for" loop at its post statement.
@@ -4949,8 +4951,7 @@ ContinueStmt = "continue" [ Label ] .If there is a label, it must be that of an enclosing "for" statement, and that is the one whose execution -advances -(§For statements). +advances.
Goto statements
@@ -5169,8 +5170,8 @@ constant ands
is evaluated.The built-in function
new
takes a typeT
and returns a value of type*T
. -The memory is initialized as described in the section on initial values -(§The zero value). +The memory is initialized as described in the section on +initial values.@@ -5202,8 +5203,8 @@ The built-in functionmake
takes a typeT
, which must be a slice, map or channel type, optionally followed by a type-specific list of expressions. It returns a value of typeT
(not*T
). -The memory is initialized as described in the section on initial values -(§The zero value). +The memory is initialized as described in the section on +initial values.@@ -5912,7 +5913,7 @@ Calls toAlignof
,Offsetof
, andSize and alignment guarantees
-For the numeric types (§Numeric types), the following sizes are guaranteed: +For the numeric types, the following sizes are guaranteed:
-- 2.50.0