]> Cypherpunks repositories - gostls13.git/commit
spec: permit parentheses around builtin function names
authorRobert Griesemer <gri@golang.org>
Mon, 27 Oct 2014 23:31:15 +0000 (16:31 -0700)
committerRobert Griesemer <gri@golang.org>
Mon, 27 Oct 2014 23:31:15 +0000 (16:31 -0700)
commitccc713c7caa8900facc99bffaad4ee4a22013b01
tree1e0a64649f9554895c6097a42fafead1ba9619f9
parente71c9cbe260941bfb322c69e4a4f10b4323a228e
spec: permit parentheses around builtin function names

Not a language change.

This is simply documenting the status quo which permits
builtin function names to be parenthesized in calls; e.g.,
both

        len(s)
and
        (((len)))(s)

are accepted by all compilers and go/types.

Changed the grammar by merging the details of BuiltinCall
with ordinary Calls. Also renamed the Call production to
Arguments which more clearly identifies that part of the
grammar and also matches better with its counterpart on
the declaration side (Parameters).

The fact that the first argument can be a type (for builtins)
or cannot be a type (for regular function calls) is expressed
in the prose, no need to make the grammar more complicated.

Fixes #9001.

LGTM=iant, r, rsc
R=r, rsc, iant, ken, dave
CC=golang-codereviews
https://golang.org/cl/160570043
doc/go_spec.html