1
0
mirror of https://github.com/golang/go synced 2024-11-24 08:50:14 -07:00
go/doc
Robert Griesemer 187ee2cf2b spec: receiver declaration is just a parameter declaration
This CL removes the special syntax for method receivers and
makes it just like other parameters. Instead, the crucial
receiver-specific rules (exactly one receiver, receiver type
must be of the form T or *T) are specified verbally instead
of syntactically.

This is a fully backward-compatible (and minor) syntax
relaxation. As a result, the following syntactic restrictions
(which are completely irrelevant) and which were only in place
for receivers are removed:

a) receiver types cannot be parenthesized
b) receiver parameter lists cannot have a trailing comma

The result of this CL is a simplication of the spec and the
implementation, with no impact on existing (or future) code.

Noteworthy:

- gc already permits a trailing comma at the end of a receiver
  declaration:

  func (recv T,) m() {}

  This is technically a bug with the current spec; this CL will
  legalize this notation.

- gccgo produces a misleading error when a trailing comma is used:

  error: method has multiple receivers

  (even though there's only one receiver)

- Compilers and type-checkers won't need to report errors anymore
  if receiver types are parenthesized.

Fixes #4496.

LGTM=iant, rsc
R=r, rsc, iant, ken
CC=golang-codereviews
https://golang.org/cl/101500044
2014-06-24 16:25:09 -07:00
..
articles doc: say that race detector is supported on freebsd 2014-06-21 20:19:32 +04:00
codewalk doc: fix typo in sharemem codewalk 2014-05-21 14:34:20 -07:00
devel doc: document Go 1.3 2014-06-19 10:26:57 +10:00
gopher doc/gopher: fix typo in README 2014-03-26 11:23:33 +11:00
play doc: remove godocs.js and playground.js from core repo 2013-08-01 15:09:18 +10:00
progs doc/progs: don't try building cgo tests if CGO_ENABLED=0 2013-10-11 08:55:13 -07:00
asm.html doc: fix an article 2014-04-27 07:40:48 -07:00
cmd.html doc: re-organize golang.org site content 2013-09-16 15:47:13 +10:00
code.html doc: update installation instructions 2013-11-21 07:55:29 +11:00
contrib.html doc/contrib.html: update links, mailing lists and link to 1.3 release note. 2014-06-01 22:48:57 -04:00
contribute.html doc/contribute.html: link to wiki for more code review information 2014-04-25 20:09:04 -07:00
debugging_with_gdb.html doc/debugging_with_gdb.html: add introductory disclaimer 2014-04-26 10:18:17 -06:00
docs.html doc: link to release history from /doc/ 2014-06-12 13:31:13 +10:00
effective_go.html doc/effective_go.html: a little more about errors 2014-05-14 13:46:58 -07:00
gccgo_contribute.html doc: update gccgo docs 2013-06-20 14:49:15 -07:00
gccgo_install.html doc: fix broken link to RTEMS Go wiki page 2014-04-28 06:27:22 -07:00
go1.1.html doc: fix a few broken links 2013-10-09 07:05:43 +11:00
go1.2.html encoding/gob: do not use MarshalText, UnmarshalText 2013-11-13 21:29:19 -05:00
go1.3.html doc: add release note for 'godoc -analysis' 2014-06-12 10:08:54 -04:00
go1.4.txt doc/go1.4.txt: text/scanner: IsIdentRune 2014-06-24 11:09:13 -07:00
go1.html doc: link to new downloads page 2014-06-13 16:34:52 +10:00
go1compat.html doc: re-organize golang.org site content 2013-09-16 15:47:13 +10:00
go_faq.html doc: replace absolute links to golang.org with relative links 2014-05-07 18:49:13 +04:00
go_mem.html doc: fix happens-before rules for buffered channels 2014-06-05 21:08:28 +04:00
go_spec.html spec: receiver declaration is just a parameter declaration 2014-06-24 16:25:09 -07:00
go-logo-black.png
go-logo-blue.png
go-logo-white.png
help.html doc/help.html: fix typo in word order 2014-04-14 13:03:03 -07:00
ie.css
install-source.html doc/install-source.html: document that GO386 will be auto-detected when building on both 386 and amd64. 2014-06-04 19:53:37 -04:00
install.html doc: link to new downloads page 2014-06-13 16:34:52 +10:00
logo-153x55.png
root.html doc: remove "Code that grows with grace" video from front page 2014-02-11 16:00:44 +11:00
share.png
sieve.gif
tos.html