Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
2bfa9574
Commit
2bfa9574
authored
Oct 24, 2008
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Preparation for varargs: Proposal for syntax.
DELTA=11 (7 added, 0 deleted, 4 changed) OCL=17772 CL=17804
parent
7466b61b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
go_spec.txt
doc/go_spec.txt
+11
-4
No files found.
doc/go_spec.txt
View file @
2bfa9574
...
...
@@ -4,7 +4,7 @@ The Go Programming Language Specification (DRAFT)
Robert Griesemer, Rob Pike, Ken Thompson
----
(October 2
3
, 2008)
(October 2
4
, 2008)
This document is a semi-formal specification of the Go systems
...
...
@@ -1269,7 +1269,7 @@ and result types.
FunctionType = "(" [ ParameterList ] ")" [ Result ] .
ParameterList = ParameterDecl { "," ParameterDecl } .
ParameterDecl = [ IdentifierList ]
Type
.
ParameterDecl = [ IdentifierList ]
( Type | "..." )
.
Result = Type | "(" ParameterList ")" .
In ParameterList, the parameter names (IdentifierList) either must all be
...
...
@@ -1277,13 +1277,20 @@ present, or all be absent. If the parameters are named, each name stands
for one parameter of the specified type. If the parameters are unnamed, each
type stands for one parameter of that type.
For the last incoming parameter only, instead of a parameter type one
may write "...". The ellipsis indicates that the last parameter stands
for an arbitrary number of additional arguments of any type (including
no additional arguments). If the parameters are named, the identifier
list immediately preceding "..." must contain only one identifier (the
name of the last parameter).
()
(x int)
() int
(string)
(string
, float, ...
)
(a, b int, z float) bool
(a, b int, z float) (bool)
(a, b int, z float) (success bool)
(a, b int, z float
, opt ...
) (success bool)
(int, int, float) (float, *[]int)
A variable can hold only a pointer to a function, not a function value.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment