The Go Programming Language
----
-(April 18, 2008)
+(April 29, 2008)
This document is an informal specification/proposal for a new systems programming
language.
-44
+3.24e-7
+
The string type
----
point), and will appear as two code points if placed in a string
literal.
+
More about types
----
f func();
}
+
Compound Literals
----
Unresolved issues: Are elements converted? What about length?
+
Map Literals
----
Unresolved issues: Are elements converted?
Colon for a separator or comma?
+
Struct literals
----
Receiver = "(" identifier Type ")" .
Parameters = "(" [ ParameterList ] ")" .
ParameterList = ParameterSection { "," ParameterSection } .
- ParameterSection = [ IdentifierList ] Type .
+ ParameterSection = IdentifierList Type .
Result = Type | "(" ParameterList ")" .
// Function types
Unresolved issues: Are there method literals? How do you use them?
+
Methods
----
TODO: details about reflection
+Equivalence of types
+---
+
+Types are structurally equivalent: Two types are equivalent ('equal') if they
+are constructed the same way from equivalent types.
+
+For instance, all variables declared as "*int" have equivalent type,
+as do all variables declared as "map [string] chan int".
+
+More precisely, two struct types are equivalent if they have exactly the same fields
+in the same order, with equal field names and types. For all other composite types,
+the types of the components must be equivalent. Additionally, for equivalent arrays,
+the lengths must be equal (or absent), and for channel types the mode must be equal
+(">", "<", or none). The names of receivers, parameters, or result values of functions
+are ignored for the purpose of type equivalence.
+
+For instance, the struct type
+
+ struct {
+ a int;
+ b int;
+ f *func (m *[32] float, x int, y int) bool
+ }
+
+is equivalent to
+
+ struct {
+ a, b int;
+ f *F
+ }
+
+where "F" is declared as "func (a *[30 + 2] float, b, c int) (ok bool)".
+
+Finally, two interface types are equivalent if they both declare the same set of
+methods: For each method in the first interface type there is a method in the
+second interface type with the same method name and equivalent signature, and
+vice versa. Note that the declaration order of the methods is not relevant.
+
+
Literals
----
t.f == 0.0
t.next == nil
+
Export declarations
----
conversion failure if the result is not of pointer type, such
as an any variable holding an int?
+
Allocation
----
contents of a TypeName() conversion; i expected expr instead and that's what
the others have.
+
The constant generator 'iota'
----
Program = PackageClause { ImportDecl } { Declaration } .
+
TODO
----