Commit graph

401 commits

Author SHA1 Message Date
Shenghou Ma
2195f1aa04 doc/go_spec: fix broken link
Part of issue 3424

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5955049
2012-03-30 14:04:03 +08:00
Jeremy Jackins
7e054266c9 doc: various typos, remove apostrophes from ordinals
R=golang-dev, r, r
CC=golang-dev
https://golang.org/cl/5845059
2012-03-19 08:26:36 +11:00
Rob Pike
883a96d950 spec: delete references to unsafe.Reflect,Typeof,Unreflect
They have been deleted from package unsafe.
Also delete their appearance in exp/types.

Fixes #3338.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5847056
2012-03-17 22:50:59 +11:00
Robert Griesemer
82fc28c0f5 go spec: fix inaccuracy in type identity definition
Pointed out by Steven Blenkinsop (steven099@gmail.com)
via golang-nuts.

R=r, dsymonds
CC=golang-dev
https://golang.org/cl/5783087
2012-03-12 20:27:27 -07:00
Robert Griesemer
11d8b155ce go_spec: no known implementation differences anymore
R=r, rsc, iant, ken
CC=golang-dev
https://golang.org/cl/5781048
2012-03-07 22:17:40 -08:00
Andrew Gerrand
a22b0f82a2 doc: add command docs page, canonicalize reference paths
R=golang-dev, kyle, r
CC=golang-dev
https://golang.org/cl/5728055
2012-03-05 15:30:27 +11:00
Robert Griesemer
103c9db747 spec: clarifications around exports, uniqueness of identifiers
- Define what it means for two identifiers to be unique.

- The current spec is incorrect about exported
identifiers: for instance, it excluded fields
of non-exported types of exported variables
from being exported. It is easier to leave
the detailed specification away and let the
rest of the spec govern access of exported
identifiers.

- The current spec is incorrect about qualified
identifiers: It simply required that an identifier
be exported to be valid in a qualified identifier.
However, qualified identifiers can only access
exported identifiers declared in the package
block of the imported package.

Fixes #1551.

R=r, rsc, iant, ken
CC=golang-dev
https://golang.org/cl/5711043
2012-03-01 13:57:49 -08:00
Robert Griesemer
953f2dec89 spec: minor tweaks
- more idiomatic examples of pointer types
- show use of _ in examples of function types
- remove "legal:" qualification in examples
  for consistency

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5711054
2012-03-01 10:35:15 -08:00
Stefan Nilsson
c50074e510 doc: add a bunch of missing <p> tags
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5707065
2012-02-29 15:07:52 -08:00
Russ Cox
8e38b17a90 spec: apply method sets, embedding to all types, not just named types
When we first wrote the method set definition, we had long
discussions about whether method sets applied to all types
or just named types, and we (or at least I) concluded that it
didn't matter: the two were equivalent points of view, because
the only way to introduce a new method was to write a method
function, which requires a named receiver type.

However, the addition of embedded types changed this.
Embedding can introduce a method without writing an explicit
method function, as in:

        var x struct {
                sync.Mutex
        }

        var px *struct {
                sync.Mutex
        }

        var _, _ sync.Locker = &x, px

The edits in this CL make clear that both &x and px satisfy
sync.Locker.  Today, gccgo already works this way; 6g does not.

R=golang-dev, gri, iant, r
CC=golang-dev
https://golang.org/cl/5702062
2012-02-29 15:54:06 -05:00
Russ Cox
0201e373e5 spec: shorten heading for complex, real, imag
In the current TOC it sticks out quite a bit.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5705053
2012-02-29 15:20:11 -05:00
Robert Griesemer
7c1cb37b55 spec: use the term "lexical token" (rather then "lexical symbol")
Fix for minor inconsistency.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5709058
2012-02-29 10:39:20 -08:00
Robert Griesemer
da633714fd spec: fix sentence
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5706065
2012-02-29 09:06:05 -08:00
Robert Griesemer
2c9e1637d2 go spec: inside functions, variables must be evaluated.
Fixes #1612.

R=r, rsc, iant, ken, remyoudompheng, ken, r
CC=golang-dev
https://golang.org/cl/5700068
2012-02-28 17:44:24 -08:00
Russ Cox
fad10f9c1c spec: allow disallow of \uFFFD in import path
Turns out U+FFFD is a graphic character too.

http://play.golang.org/p/YblCfKAfko

R=gri
CC=golang-dev
https://golang.org/cl/5699052
2012-02-23 22:46:04 -05:00
Robert Griesemer
ac4055b2c5 go spec: import path implementation restriction
R=rsc, r, r, adg
CC=golang-dev
https://golang.org/cl/5688074
2012-02-22 23:51:25 -08:00
Rob Pike
818e3cdb09 spec: refine the wording about variables in type switches
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5686064
2012-02-22 16:25:55 +11:00
Russ Cox
9c08d65084 spec: make all comparison results untyped bool
Or, depending on your point of view, make the
comparisons satisfy any surrounding boolean type.

Also, fix a few foo_bar -> fooBar in code fragments.

Fixes #2561.

R=golang-dev, r, bradfitz, gri, iant, kevlar
CC=golang-dev
https://golang.org/cl/5671096
2012-02-21 22:04:30 -05:00
Robert Griesemer
3908467b1f go spec: struct comparison only compares non-blank fields
Fixes #3031.

R=golang-dev, rsc, r, iant
CC=golang-dev
https://golang.org/cl/5676054
2012-02-16 14:13:17 -08:00
Ian Lance Taylor
9126c6570c spec: clarify implementation restrictions on untyped floats
Drop reference to "machine type."  Specify that integer
overflow must be an error.  Drop requirement that exponent
must be 128 bits--that's a lot.  Clarify that floating point
expressions may be rounded, including intermediate values.

This is a reworking of https://golang.org/cl/5577068/ .

Fixes #2789.

R=r, rsc, r, gri, ken, ken, iant
CC=golang-dev, remyoudompheng
https://golang.org/cl/5655049
2012-02-13 11:25:56 -08:00
Rob Pike
7bd6ebb104 spec: strings are more slices than arrays
Thanks to Aaron Kemp for noticing.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5645097
2012-02-13 23:39:56 +11:00
Robert Griesemer
b1d9ae9406 go spec: method names must be unique
Fixes #2916.

R=golang-dev, remyoudompheng, r, rsc
CC=golang-dev
https://golang.org/cl/5652064
2012-02-12 20:03:30 -08:00
Rob Pike
8040f9bb86 spec: typographical adjustment for ellipsis
The paragraph describing the ellipses presents the horizontal ellipsis
in two different fonts and at least on my screen they look too different.
Switch to a consistent rendering.

Of small steps are great journeys undertaken.

R=golang-dev, rsc, dsymonds, gri
CC=golang-dev
https://golang.org/cl/5650055
2012-02-13 14:38:31 +11:00
Russ Cox
7c5d6409f5 spec: address CL 5647054 comments
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5641057
2012-02-08 15:37:58 -05:00
Russ Cox
e7a138b856 spec: send on closed channel counts as "proceeding"
Other wordings are possible but defining this as one
of the ways to proceed means we don't have to add
language about this to the description of select.

Fixes #2825.

R=golang-dev, gri, r
CC=golang-dev
https://golang.org/cl/5643062
2012-02-08 15:24:48 -05:00
Russ Cox
388816ae07 spec: disallow recursive embedded interfaces
Fixes #1814.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5647054
2012-02-08 14:35:00 -05:00
Russ Cox
fd2a511253 spec: add forward links from 'method set' to where it gets used
Fixes #1797.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5645058
2012-02-08 14:28:51 -05:00
Rob Pike
fc06cadd88 go_spec: primality is elusive
This time for sure.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5634046
2012-02-07 06:59:36 +11:00
Christopher Wedgwood
6513e19532 spec: correct primes
R=r
CC=golang-dev
https://golang.org/cl/5627048
2012-02-04 10:34:31 +11:00
Rob Pike
a044154a4c spec: restore primality
9 is prime if it's a hot day.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5630043
2012-02-04 06:16:02 +11:00
Russ Cox
c739dd2299 spec: 9 only looks prime
Fixes #2870.

R=golang-dev, agl, lvd
CC=golang-dev
https://golang.org/cl/5618050
2012-02-03 10:30:52 -05:00
Robert Griesemer
9c3d876db1 go/spec: Update language on map types.
Fixes #2803.

R=r
CC=golang-dev
https://golang.org/cl/5601053
2012-01-30 15:31:33 -08:00
Rob Pike
633a2ce096 spec: function invocation, panic on *nil
Document that indirection through a nil pointer will panic.
Explain function invocation.
This section will need more work, but it's a start.

Fixes #1865.
Fixes #2252.

R=rsc, iant, r
CC=golang-dev
https://golang.org/cl/5532114
2012-01-23 08:40:13 -08:00
Andrew Gerrand
7cb21a79a4 godoc: specify HTML page metadata with a JSON blob
This allows HTML pages to specify arbitrary data in a header:

<!--{
        "Title": "The page title",
        ...
}-->

replacing the old style comments:

<!-- title The page title -->

R=gri, rsc, r, bradfitz, dsymonds
CC=golang-dev
https://golang.org/cl/5532093
2012-01-19 11:24:54 +11:00
Rob Pike
5f7337769c spec: change the wording regarding select statement choice
s/pseudo-random fair/uniform pseudo-random/
This careful word choice soothes the theoretically inclined.

R=golang-dev, rsc, gri
CC=golang-dev
https://golang.org/cl/5528098
2012-01-13 13:38:36 -08:00
Robert Griesemer
1320ce00c4 spec: pointer comparison for pointers to 0-sized variables
- define "0-sized"
- add clarifying sentence to pointer comparison
- removed notion "location" which was used only in pointer comparisons
  and which was never defined

Fixes #2620.

R=r, rsc, iant
CC=golang-dev
https://golang.org/cl/5528053
2012-01-09 16:54:24 -08:00
Robert Griesemer
11b7c89b26 go spec: be precise about newlines
Several places mentioned tokens spanning "multiple lines"
which is not a well-defined term in the spec; newline is.

R=golang-dev, rsc, r
CC=golang-dev
https://golang.org/cl/5490046
2011-12-15 10:51:51 -08:00
Rob Pike
c26ca912e5 spec: skip carriage returns in raw literals
This change guarantees that whether the line ending convention
when the source is created includes carriage returns is irrelevant
to the value of the string. See issue 680.

The compilers do not yet implement this.

R=golang-dev, adg, r, gri, rsc, iant
CC=golang-dev
https://golang.org/cl/5491043
2011-12-14 21:52:41 -08:00
Robert Griesemer
599c18fa3f spec: values of underlying type uintptr can be converted to unsafe.Pointer
Not a language change, just stating the facts.

Fixes #1793.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5488071
2011-12-13 17:22:11 -08:00
Russ Cox
83f648c962 spec: allow comparison of structs, arrays containing comparable values
Also, clarify when interface comparison panics and
that comparison to nil is a special syntax rather than
a general comparison rule.

R=r, gri, r, iant, cw, bradfitz
CC=golang-dev
https://golang.org/cl/5440117
2011-12-12 22:21:46 -05:00
Robert Hencke
1084ab98b7 spec: adjust complex constant example
Fixes https://golang.org/cl/5444053/#msg41

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5478058
2011-12-10 10:04:33 -08:00
Russ Cox
ef1c535727 spec: examples of untyped boolean, string constants
This is a spec correction, not a language change.
The implementations have behaved like this for years
(and there are tests to that effect), and elsewhere in
the spec true and false are defined to be untyped
boolean constants.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5477047
2011-12-09 00:13:19 -05:00
Russ Cox
6a47bb4974 spec: remove redundant, outdated definition of default literal types
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5480047
2011-12-09 00:12:49 -05:00
Russ Cox
d7f050a73e spec: rune is now an alias for int32
R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/5467048
2011-12-09 00:11:43 -05:00
Charles L. Dorian
9a358df947 spec: fix typo in example comment
R=rsc, golang-dev
CC=golang-dev
https://golang.org/cl/5475046
2011-12-08 22:27:14 -05:00
Russ Cox
a933635579 spec: var x = 'a' defaults to type rune
R=gri, r, r, adg, iant, ken
CC=golang-dev
https://golang.org/cl/5444053
2011-12-08 21:48:19 -05:00
Russ Cox
98553f1422 spec: remove contentious composite literal shortening
R=gri, r, gustavo, r
CC=golang-dev
https://golang.org/cl/5451099
2011-12-05 14:22:23 -05:00
Russ Cox
5f49456465 spec: additional composite literal shortenings per Go 1 plan
R=golang-dev, gri, r, r
CC=golang-dev
https://golang.org/cl/5449067
2011-12-02 14:12:53 -05:00
Russ Cox
8a8445ba71 spec: pointer to array can be sliced
This has always been true, but we lost it from the spec
somewhere along the way, probably when we disallowed
the general 'pointer to anything sliceable' slice case.

R=gri
CC=golang-dev
https://golang.org/cl/5437121
2011-12-02 13:11:30 -05:00
Russ Cox
4dfe976d97 spec: avoid slice of array literal
R=gri
CC=golang-dev
https://golang.org/cl/5451078
2011-12-02 12:30:20 -05:00
David Symonds
72a2979ef0 spec: update spacing to match gofmt, where reasonable.
R=gri, rsc
CC=golang-dev
https://golang.org/cl/5327053
2011-11-29 15:47:36 -08:00
Russ Cox
6e3e380923 allow direct conversion between string and named []byte, []rune
The allowed conversions before and after are:
        type Tstring string
        type Tbyte []byte
        type Trune []rune

        string <-> string  // ok
        string <-> []byte  // ok
        string <-> []rune // ok
        string <-> Tstring // ok
        string <-> Tbyte // was illegal, now ok
        string <-> Trune // was illegal, now ok

        Tstring <-> string  // ok
        Tstring <-> []byte  // ok
        Tstring <-> []rune // ok
        Tstring <-> Tstring // ok
        Tstring <-> Tbyte // was illegal, now ok
        Tstring <-> Trune // was illegal, now ok

Update spec, compiler, tests.  Use in a few packages.

We agreed on this a few months ago but never implemented it.

Fixes #1707.

R=golang-dev, gri, r
CC=golang-dev
https://golang.org/cl/5421057
2011-11-22 12:30:02 -05:00
Russ Cox
d03611f628 allow copy of struct containing unexported fields
An experiment: allow structs to be copied even if they
contain unexported fields.  This gives packages the
ability to return opaque values in their APIs, like reflect
does for reflect.Value but without the kludgy hacks reflect
resorts to.

In general, we trust programmers not to do silly things
like *x = *y on a package's struct pointers, just as we trust
programmers not to do unicode.Letter = unicode.Digit,
but packages that want a harder guarantee can introduce
an extra level of indirection, like in the changes to os.File
in this CL or by using an interface type.

All in one CL so that it can be rolled back more easily if
we decide this is a bad idea.

Originally discussed in March 2011.
https://groups.google.com/group/golang-dev/t/3f5d30938c7c45ef

R=golang-dev, adg, dvyukov, r, bradfitz, jan.mercl, gri
CC=golang-dev
https://golang.org/cl/5372095
2011-11-15 12:20:59 -05:00
Russ Cox
efb74460c3 spec: disallow general func, map comparisons
R=golang-dev, gri, r, r
CC=golang-dev
https://golang.org/cl/5369090
2011-11-13 22:57:45 -05:00
Rob Pike
217408abf3 crypto: update incorrect references to Cipher interface; should be Block.
R=gri, rsc, r
CC=golang-dev
https://golang.org/cl/5372050
2011-11-09 14:22:44 -08:00
Rob Pike
e223eedc8b spec: delete spurious article
A profound change to christen the new tag.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5327062
2011-11-01 20:57:17 -07:00
Russ Cox
d9877e22fe spec: add error
R=golang-dev, dsymonds, r, r
CC=golang-dev
https://golang.org/cl/5308072
2011-11-01 21:45:02 -04:00
Charles L. Dorian
44262d1574 doc: fix typo in spec example code comment
R=r, golang-dev, adg
CC=golang-dev
https://golang.org/cl/5308071
2011-11-01 15:13:33 +09:00
Robert Griesemer
b910a27396 go spec: introduce rune type
R=r, iant, rsc, r
CC=golang-dev
https://golang.org/cl/5293048
2011-11-01 01:09:22 -04:00
Russ Cox
b7ef3c9a54 spec: define that initialization is sequential
This is true of the existing implementations, and I think
it is an important property to guarantee.

R=golang-dev, r, borman, r
CC=golang-dev
https://golang.org/cl/5321058
2011-10-27 12:22:45 -07:00
Russ Cox
e40d6e066a runtime: random offset for map iteration
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5285042
2011-10-17 18:49:02 -04:00
Robert Griesemer
c5a6b05ba4 go spec: clarifying variable declaractions w/ constants
Fixes #2377.

R=r, rsc
CC=golang-dev
https://golang.org/cl/5267048
2011-10-17 12:54:18 -07:00
Robert Griesemer
3e0c0a8add go spec: "delete" built-in function
R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/5272045
2011-10-17 12:53:10 -07:00
Russ Cox
f58ed4e641 gc: disallow close on receive-only channels
Fixes #2353.
Fixes #2246.

R=golang-dev, r, gri
CC=golang-dev
https://golang.org/cl/5282042
2011-10-13 16:58:04 -04:00
Russ Cox
d1bafffa4b runtime: run goroutines during init
Fixes #583.
Fixes #1776.
Fixes #2001.
Fixes #2112.

R=golang-dev, bradfitz, r, gri
CC=golang-dev
https://golang.org/cl/5265044
2011-10-13 15:54:23 -04:00
Russ Cox
fa538114ed spec: define order of multiple assignment
R=golang-dev, r, gri
CC=golang-dev
https://golang.org/cl/5240055
2011-10-13 15:44:17 -04:00
Luuk van Dijk
77fac21e82 runtime: append([]byte, string...)
Fixes #2274

R=rsc, gri, dsymonds, bradfitz, lvd
CC=golang-dev
https://golang.org/cl/5149045
2011-10-12 15:59:23 +02:00
Ian Lance Taylor
807eb29f9f go spec: remove notes about gccgo limitations, now fixed
R=gri
CC=golang-dev
https://golang.org/cl/5164041
2011-09-29 14:50:55 -07:00
Robert Griesemer
ffe70eaa3c go spec: update section on Implementation Differences
R=rsc, r
CC=golang-dev
https://golang.org/cl/4977046
2011-08-31 15:16:51 -07:00
Robert Griesemer
38a53c7ecb go spec: (up-)date
R=rsc, bradfitz, r
CC=golang-dev
https://golang.org/cl/4738042
2011-07-14 15:58:37 -07:00
Russ Cox
58e19aa4cb go: require { } around else block
R=gri, ken, r
CC=golang-dev
https://golang.org/cl/4721044
2011-07-14 17:15:52 -04:00
Russ Cox
f4c7db0ed9 spec: disallow goto into blocks
R=gri, r, r
CC=golang-dev
https://golang.org/cl/4631045
2011-06-17 12:49:04 -04:00
Robert Griesemer
2769356dda go spec: specify constant conversions
This is not a language change.

Added paragraphs specifying which conversions
yield results that are constants.

R=r, rsc, iant, ken
CC=golang-dev
https://golang.org/cl/4515176
2011-06-13 16:47:33 -07:00
Robert Griesemer
eee70b07c1 go spec: unsafe.Alignof/Offsetof/Sizeof return uintptr
This is (indirectly) a language change. Per e-mail discussion
on golang-dev.

Fixes #1943.

R=rsc, iant, r, ken
CC=golang-dev
https://golang.org/cl/4581058
2011-06-13 16:46:42 -07:00
Robert Griesemer
95b8137a16 go spec: clarify rules for append, scope rules for :=
Fixes #1936.
Fixes #1940.

R=rsc, r, iant, ken, iant
CC=golang-dev
https://golang.org/cl/4585049
2011-06-12 12:09:50 -07:00
Robert Griesemer
636c5fac2d go spec: handle a corner case of a special case for shifts...
- Added some additional examples.
- 6g appears to implement this semantics already.

Fixes #658.

R=rsc, r, iant, ken
CC=golang-dev
https://golang.org/cl/4538119
2011-06-08 09:11:18 -07:00
Rob Pike
2f655c4bb7 spec: delete spurious tag.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4536082
2011-05-25 10:58:58 +10:00
Robert Griesemer
3c7271f057 go spec: be precise with the use of the informal ellipsis … and the Go token ...
Fixes #1867.

R=r
CC=golang-dev
https://golang.org/cl/4538092
2011-05-24 14:18:44 -07:00
Rob Pike
46f482a2fc docs: remove some prose-unworthy empty parentheses.
In our evolving style, prose should name a function "f" not "f()".

R=gri, rsc
CC=golang-dev
https://golang.org/cl/4550075
2011-05-25 06:44:09 +10:00
Rob Pike
bdbe0decc6 spec: add missing comma.
A real humdinger.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4538089
2011-05-25 06:00:07 +10:00
Robert Griesemer
32d127823f go spec: clarify rules for shifts
Note: This is not a spec change.

The spec was not clear on the result type of
constant shift expressions. Made it more
explicit and added additional examples.

Also: Remove paragraph on send expressions (they
are statements, now).

Fixes #1708.

R=rsc, r, iant, r
CC=golang-dev
https://golang.org/cl/4517074
2011-05-23 14:12:42 -07:00
Nigel Tao
703b092779 spec: fix copy to return "number of elements copied", not "number
of arguments copied".

R=gri, r
CC=golang-dev
https://golang.org/cl/4550041
2011-05-15 16:04:37 -07:00
Robert Griesemer
32b822f29a go spec: fix error in production syntax
Fix analoguous error in ebnf.go which already
correctly accepted an empty production.

Fixes #1821.

R=r
CC=golang-dev
https://golang.org/cl/4526056
2011-05-13 12:54:51 -07:00
Robert Griesemer
5473103666 go spec: clarify semantics of range clause
This CL proposes some subtle language changes
in an attempt to clarify the semantics of range
clauses and simplify uses of maps.

- nil maps behave like empty maps; but attempting
  to set a value in a nil map causes a run-time panic
- nil channels are never ready for communication;
  sending or reading from a nil channel blocks forever
- if there is only one index iteration variable in a
  range clause and len(range expression) would be a constant,
  the range expression is not evaluated.
  (was discrepancy with len/cap before)
- the notion of what is a constant expression len(x)
  for (pointer to) arrays x has been generalized and
  simplified (can still be syntactically decided)
  (before: more restrictive syntactic rule that was not
  consistently implemented)

Fixes #1713.

R=r, rsc, iant, ken2, r2, bradfitz, rog
CC=golang-dev
https://golang.org/cl/4444050
2011-05-12 09:15:59 -07:00
Rob Pike
38d7bcf5e2 go spec: fix up HTML glitches.
Fixes #1786.

R=gri, adg
CC=golang-dev
https://golang.org/cl/4517043
2011-05-08 14:05:18 -07:00
Robert Griesemer
0e8032ca49 go spec: newlines cannot be used inside a char or "" string literal
R=r
CC=golang-dev
https://golang.org/cl/4462043
2011-05-05 09:03:00 -07:00
Robert Griesemer
bb7eb4002e go spec: clarify semantics of integer division
Fixes #1764.

R=rsc, r, iant, ken2
CC=golang-dev
https://golang.org/cl/4431082
2011-05-02 17:23:18 -07:00
Robert Griesemer
6af887ec03 go spec: restricted expressions may still be parenthesized
No language change.

- added a few examples with parentheses
- added a corresponding sentence to assignments
  (this explicitly permits: (_) = 0, currently allowed by 6g,
  gofmt, but marked as an error by gccgo).

R=rsc, r, iant
CC=golang-dev
https://golang.org/cl/4446071
2011-05-02 09:16:31 -07:00
Robert Griesemer
c134718611 undo CL 4428057 / 19e540fc7d7d
The CL introduces inconsistencies with respect to
the use of parentheses/grouping of receive operations.

««« original CL description
spec: narrow syntax for expression and select statements

This is not a language change, it simply expresses the
accepted cases explicitly in the respective productions.

R=rsc, r, iant
CC=golang-dev
https://golang.org/cl/4428057
»»»

R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4444080
2011-04-29 12:20:31 -07:00
Robert Griesemer
95f544a199 spec: narrow syntax for expression and select statements
This is not a language change, it simply expresses the
accepted cases explicitly in the respective productions.

R=rsc, r, iant
CC=golang-dev
https://golang.org/cl/4428057
2011-04-29 09:49:10 -07:00
Robert Griesemer
1bdb1803b9 go spec: for map types, mention indexing operations
(like we do for arrays and slices).

Suggested by mathieu.lonjaret@gmail.com .

R=r, rsc, iant
CC=golang-dev
https://golang.org/cl/4442074
2011-04-22 16:26:51 -07:00
Robert Griesemer
0f7acf1114 go spec: attempt at clarifying language for "append"
Specifically, fix a wrong comment.

Fixes #1717.

R=r, rsc
CC=golang-dev
https://golang.org/cl/4445050
2011-04-19 14:38:49 -07:00
Rob Pike
e6b1d424c4 spec: add parens missing from "protect" example.
Fixes #1665.

R=gri
CC=golang-dev
https://golang.org/cl/4351051
2011-04-05 11:01:25 -07:00
Ian Lance Taylor
d38d66e646 doc: gccgo now supports method expressions and multiple init functions.
R=gri
CC=golang-dev
https://golang.org/cl/4314047
2011-03-28 14:48:35 -07:00
Russ Cox
108564dabc spec: disallow unused labels
Also change labelled examples to use gofmt formatting.

R=gri, r, jnml
CC=golang-dev
https://golang.org/cl/4287046
2011-03-15 13:51:24 -04:00
Russ Cox
9f2cb86fe2 spec: remove closed from language, replaced by x, ok = <-c
R=gri, r, r2
CC=golang-dev
https://golang.org/cl/4249065
2011-03-11 14:47:02 -05:00
Robert Griesemer
fb64e0d96f go spec: clarify return statement rules
Added example of a return statement w/o expressions
in a function with a _ result parameter.

See also: http://code.google.com/p/go/issues/detail?id=1586

R=rsc, r, iant
CC=golang-dev
https://golang.org/cl/4266049
2011-03-07 16:29:07 -08:00
Robert Griesemer
967a2b38cd go spec: minor clarification of scope rule for functions
R=rsc, iant, r, r2
CC=golang-dev
https://golang.org/cl/4256050
2011-03-03 15:24:28 -08:00
Rob Pike
966bf71366 docs: make "runtime" a word only as a name for the package.
Computer people have an agglutinating streak that I like to resist.
As a time of execution: run time.
As an adjective: run-time.
As a noun: run-time support/code/library.

Signed,
Mr. Pedant.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4252048
2011-03-01 13:54:22 -08:00
Robert Griesemer
a1368a6ad0 go spec: make condition mandatory in if statements
Plus a few minor HTML fixes.

Fixes #1535.

R=r, rsc, ken2, iant, r2
CC=golang-dev
https://golang.org/cl/4185065
2011-02-22 15:31:57 -08:00