var ch *chan int;
ch = new(chan int); // new returns type *chan int
+
Function types
----
1. No identifier may be declared twice in a single scope.
2. A language entity may only be referred to within its scope.
3. Field and method identifiers may be used only to select elements
- from the corresponding types. In effect, the field selector operator
+ from the corresponding types, and only after those types are fully
+ declared. In effect, the field selector operator
'.' temporarily re-opens the scope of such identifiers (see Expressions).
4. Forward declaration: A type of the form "*T" may be mentioned at a point
- where "T" is not yet declared. The declaration of "T" must follow in the
- same package and "T" must be visible at the end of the block containing "*T".
+ where "T" is not yet declared. The full declaration of "T" must be within a
+ block containing the forward declaration, and the forward declaration
+ refers to the innermost such full declaration.
Global declarations optionally may be marked for export with the reserved word
"export". Local declarations can never be exported.
Export should be identifier-based: an identifier is either exported or not, and thus
visible or not in importing package.
-[OLD
- Declaration = ConstDecl | TypeDecl | VarDecl | FunctionDecl | ExportDecl .
-END]
-
Const declarations
----
)
-TODO: should iota work in var, type, func decls too?
-
-
Statements
----