mirror of
https://github.com/golang/go
synced 2024-11-05 18:36:08 +00:00
Package-export proposal:
- syntax change - missing: corresponding language DELTA=5 (2 added, 0 deleted, 3 changed) OCL=19221 CL=19352
This commit is contained in:
parent
2567c073ea
commit
a1c85ed83e
1 changed files with 5 additions and 3 deletions
|
@ -4,7 +4,7 @@ The Go Programming Language Specification (DRAFT)
|
||||||
Robert Griesemer, Rob Pike, Ken Thompson
|
Robert Griesemer, Rob Pike, Ken Thompson
|
||||||
|
|
||||||
----
|
----
|
||||||
(November 7, 2008)
|
(November 13, 2008)
|
||||||
|
|
||||||
|
|
||||||
This document is a semi-formal specification of the Go systems
|
This document is a semi-formal specification of the Go systems
|
||||||
|
@ -85,6 +85,8 @@ Open issues:
|
||||||
with nil
|
with nil
|
||||||
[ ] consider syntactic notation for composite literals to make them parseable w/o type information
|
[ ] consider syntactic notation for composite literals to make them parseable w/o type information
|
||||||
(require ()'s in control clauses)
|
(require ()'s in control clauses)
|
||||||
|
[ ] global var decls: "var a, b, c int = 0, 0, 0" is ok, but "var a, b, c = 0, 0, 0" is not
|
||||||
|
(seems inconsistent with "var a = 0", and ":=" notation)
|
||||||
|
|
||||||
|
|
||||||
Decisions in need of integration into the doc:
|
Decisions in need of integration into the doc:
|
||||||
|
@ -542,7 +544,7 @@ a package, constant, type, struct field, variable, parameter, result,
|
||||||
function, method) and specifies properties of that entity such as its type.
|
function, method) and specifies properties of that entity such as its type.
|
||||||
|
|
||||||
Declaration =
|
Declaration =
|
||||||
[ "export" ]
|
[ "export" | "package" ]
|
||||||
( ConstDecl | TypeDecl | VarDecl | FunctionDecl | MethodDecl ) .
|
( ConstDecl | TypeDecl | VarDecl | FunctionDecl | MethodDecl ) .
|
||||||
|
|
||||||
Except for function, method and abbreviated variable declarations (using ":="),
|
Except for function, method and abbreviated variable declarations (using ":="),
|
||||||
|
@ -822,7 +824,7 @@ source than the export directive itself, but it is an error to specify
|
||||||
an identifier not declared anywhere in the source file containing the
|
an identifier not declared anywhere in the source file containing the
|
||||||
export directive.
|
export directive.
|
||||||
|
|
||||||
ExportDecl = "export" ExportIdentifier { "," ExportIdentifier } .
|
ExportDecl = [ "package" ] "export" ExportIdentifier { "," ExportIdentifier } .
|
||||||
ExportIdentifier = QualifiedIdent .
|
ExportIdentifier = QualifiedIdent .
|
||||||
|
|
||||||
export sin, cos
|
export sin, cos
|
||||||
|
|
Loading…
Reference in a new issue