From 462a17e0f3ac22174cba34dbfb488695f4ddfcd0 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Fri, 22 Mar 2013 15:36:04 -0700 Subject: [PATCH] =?utf8?q?spec:=20remove=20most=20=C2=A7links=20for=20the?= =?utf8?q?=20now=20more=20common=20in-text=20links?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Also: - more consistenly use "xxx" statement rather than 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 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.

@@ -866,8 +866,8 @@ distinct arrays always represent distinct storage. The array underlying a slice may extend past the end of the slice. The capacity is a measure of that extent: it is the sum of the length of the slice and the length of the array beyond the slice; -a slice of length up to that capacity can be created by `slicing' a new -one from the original slice (§Slices). +a slice of length up to that capacity can be created by +slicing a new one from the original slice. The capacity of a slice a can be discovered using the built-in function cap(a).

@@ -1236,8 +1236,8 @@ KeyType = Type .

-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.

Function declarations

@@ -2207,7 +2210,7 @@ For array and slice literals the following rules apply:

-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:

  • Channel values are comparable. - Two channel values are equal if they were created by the same call to 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.
  • @@ -3617,8 +3620,8 @@ type 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.
  • @@ -3816,8 +3819,8 @@ A constant comparison always yields an untyped boolean constant. If the left operand of a constant shift expression is an untyped constant, the result is an integer constant; otherwise it is a constant of the same -type as the left operand, which must be of integer type -(§Arithmetic operators). +type as the left operand, which must be of +integer type. Applying all other operators to untyped constants results in an untyped constant of the same kind (that is, a boolean, integer, floating-point, complex, or string constant). @@ -4440,8 +4443,7 @@ in the TypeSwitchGuard.

    -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.

    @@ -4593,8 +4595,8 @@ the range clause is equivalent to the same clause with only the first variable p The range expression is evaluated once before beginning the loop, with one exception. If the range expression is an array or a pointer to an array and only the first iteration value is present, only the range expression's -length is evaluated; if that length is constant by definition -(see §Length and capacity), +length is evaluated; if that length is constant +by definition, the range expression itself will not be evaluated.

    @@ -4872,7 +4874,7 @@ func complexF2() (re float64, im float64) {
  • The expression list may be empty if the function's result - type specifies names for its result parameters (§Function types). + type specifies names for its result parameters. The result parameters act as ordinary local variables and the function may assign values to them as necessary. The "return" statement returns the values of these variables. @@ -4892,8 +4894,8 @@ func (devnull) Write(p []byte) (n int, _ error) {

    -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 and s is evaluated.

    The built-in function new takes a type T 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 function make takes a type T,
     which must be a slice, map or channel type,
     optionally followed by a type-specific list of expressions.
     It returns a value of type T (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 to Alignof, Offsetof, and
     

    Size 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