From: Robert Griesemer Date: Mon, 19 Oct 2009 20:13:59 +0000 (-0700) Subject: - method names in method sets/interfaces must be all different X-Git-Tag: weekly.2009-11-06~265 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d4d4ff0d836fc1d7fc4e860ed0c1642577a6853b;p=gostls13.git - method names in method sets/interfaces must be all different - specify evaluation order of floating-point expressions as discussed - specify floating point conversion rounding as discussed - slightly reformatted section on conversions to make it more readable (hopefully) - fixed production for interpreted_string_lit - components were not properly tagged before because of """ instead of `"` R=go-dev DELTA=83 (41 added, 11 deleted, 31 changed) OCL=35864 CL=35885 --- diff --git a/doc/go_spec.html b/doc/go_spec.html index afb85de02b..1f0b520904 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -362,7 +362,7 @@ A sequence of string literals is concatenated to form a single string. StringLit = string_lit { string_lit } . string_lit = raw_string_lit | interpreted_string_lit . raw_string_lit = "`" { unicode_char } "`" . -interpreted_string_lit = """ { unicode_value | byte_value } """ . +interpreted_string_lit = `"` { unicode_value | byte_value } `"` .
@@ -490,6 +490,7 @@ The method set of the corresponding pointer type *T
 is the set of all methods with receiver *T or T
 (that is, it also contains the method set of T).
 Any other type has an empty method set.
+In a method set, each method must have a unique name.
 

The static type (or just type) of a variable is the @@ -855,7 +856,7 @@ func (n int) (func (p* T))

Interface types

-An interface type specifies a method set called its interface. +An interface type specifies a method set called its interface. A variable of interface type can store a value of any type with a method set that is any superset of the interface. Such a type is said to implement the interface. An interface value may be nil. @@ -864,10 +865,15 @@ that is any superset of the interface. Such a type is said to

 InterfaceType      = "interface" "{" [ MethodSpecList ] "}" .
 MethodSpecList     = MethodSpec { ";" MethodSpec } [ ";" ] .
-MethodSpec         = identifier Signature | InterfaceTypeName .
+MethodSpec         = MethodName Signature | InterfaceTypeName .
+MethodName         = identifier .
 InterfaceTypeName  = TypeName .
 
+

+As with all method sets, in an interface type, each method must have a unique name. +

+
 // A simple File interface
 interface {
@@ -935,8 +941,7 @@ as the File interface.
 

An interface may contain an interface type name T in place of a method specification. -In this notation, T must denote a different interface type -and the effect is equivalent to enumerating the methods of T explicitly +The effect is equivalent to enumerating the methods of T explicitly in the interface.

@@ -1766,7 +1771,6 @@ which is a function with a receiver.
 MethodDecl = "func" Receiver MethodName Signature [ Body ] .
 Receiver = "(" [ identifier ] [ "*" ] BaseTypeName ")" .
-MethodName = identifier .
 BaseTypeName = identifier .
 
@@ -3010,55 +3014,73 @@ Conversion = LiteralType "(" Expression ")" .

-The following conversion rules apply: +In general, a conversion succeeds if the value of x is +assignment compatible with type T, +or if the value would be assignment compatible with type T if the +value's type, or T, or any of their component types were unnamed. +Usually, such a conversion changes the type but not the representation of the value +of x and thus has no run-time cost.

-
  • -5c) Converting a slice of bytes yields a string whose successive +Converting a slice of bytes yields a string whose successive bytes are those of the slice. If the slice value is nil, the result is the empty string. @@ -3066,7 +3088,7 @@ the result is the empty string. string([]byte{'h', 'e', 'l', 'l', 'o'}) // "hello"
  • - +

    There is no linguistic mechanism to convert between pointers and integers. @@ -3152,7 +3174,15 @@ overflow etc. errors being caught. When evaluating the elements of an assignment or expression, all function calls, method calls and communication operations are evaluated in lexical left-to-right -order. Otherwise, the order of evaluation is unspecified. +order. +

    + +

    +Floating-point operations within a single expression are evaluated according to +the associativity of the operators. Explicit parentheses affect the evaluation +by overriding the default associativity. +In the expression x + (y + z) the addition y + z +is performed before adding x.

    @@ -4132,7 +4162,7 @@ guaranteed to stay in the language. They do not return a result.

    -Call       Behavior
    +Function   Behavior
     
     print      prints all arguments; formatting of arguments is implementation-specific
     println    like print but prints spaces between arguments and a newline at the end