1
0
mirror of https://github.com/golang/go synced 2024-11-11 23:20:24 -07:00
Commit Graph

317 Commits

Author SHA1 Message Date
Robert Griesemer
5474e166bc go spec: clarifications for range clause
R=iant, r, rsc, rog
CC=golang-dev
https://golang.org/cl/2226047
2010-09-28 14:44:19 -07:00
Russ Cox
00ffd59c1a gc: fix reflect table method receiver
Fixes #451.
Fixes #770.

R=ken2
CC=golang-dev
https://golang.org/cl/2207045
2010-09-28 13:43:50 -04:00
Robert Griesemer
0e66a13d10 go_spec: EOF may insert a semicolon
R=rsc, r, iant
CC=golang-dev
https://golang.org/cl/2266043
2010-09-27 18:59:11 -07:00
Robert Griesemer
ac771a8a47 go spec: ... changes
Also: Fixed a bug in the BuiltinCall production.

R=iant, r, rsc
CC=golang-dev
https://golang.org/cl/2278041
2010-09-24 14:08:28 -07:00
Joe Poirier
d4c8a54579 doc: fix typo in go_spec.html
R=rsc
CC=golang-dev
https://golang.org/cl/2250041
2010-09-20 10:51:05 -07:00
Robert Griesemer
9e5bf27acb go_spec: consistent use of 'low', 'high' in slices section
Also: Added examples for slices with omitted index expressions.

R=r, rsc
CC=golang-dev
https://golang.org/cl/2106047
2010-09-07 16:32:35 -07:00
Scott Lawrence
0c1695b42e spec: Allow omission of low slice bound
See also https://golang.org/cl/1957045/

R=gri, rsc, r
CC=golang-dev
https://golang.org/cl/2163042
2010-09-07 14:30:17 -07:00
Robert Griesemer
947e2180e9 go_spec: fix typo (pointed out by Hiroshi Iwatani)
R=iant
CC=golang-dev
https://golang.org/cl/2128045
2010-09-07 11:14:36 -07:00
Robert Griesemer
c423e95da6 go spec clarification: arrays must be addressable to be sliceable
R=rsc
CC=golang-dev, r
https://golang.org/cl/2141041
2010-09-02 10:16:31 -07:00
Rob Pike
cb2730e60c spec: delete spurious space (missed fix from previous review)
No semantic change.

R=rsc
CC=golang-dev
https://golang.org/cl/2099041
2010-09-01 10:48:45 +10:00
Rob Pike
68f1609eb4 spec: fix a couple of tiny glitches
R=gri, rsc
CC=golang-dev
https://golang.org/cl/2078041
2010-09-01 10:40:50 +10:00
Ian Lance Taylor
659966a988 doc: Update gccgo information for recent changes.
R=r
CC=golang-dev
https://golang.org/cl/1941052
2010-08-23 17:50:30 -07:00
Rob Pike
132d2f11a8 spec: delete erroneous word 'pointer' in specification of select.
R=gri
CC=golang-dev
https://golang.org/cl/1960044
2010-08-16 06:42:41 +10:00
Stephen Ma
0d40e40f5e spec: trivial syntax fix
R=golang-dev
CC=golang-dev
https://golang.org/cl/1982042
2010-08-14 10:27:24 +10:00
Robert Griesemer
07cc6440dc go_spec: don't allow parens around the literal type of composite literals
Background: The current spec is imprecise with respect to the parsing ambiguity
for composite literals: It says that the ambiguity arises when the TypeName form
of the LiteralType is used. The following code:

    if (B) {} ...

is not using the TypeName form (but the parenthesized TypeName form) and thus
could be interpreted as:

    if ((B){}) ...

instead of

    if B {} ...

Both compilers and gofmt choose the latter interpretation. One could fix the
spec by making the clause regarding the parsing ambiguity more precise ("...using
the _possibly parenthesized_ TypeName form of the LiteralType..."). The alternative
(chosen here) is to simply disallow parenthesized literal types. Except for a single
test case (test/parentype.go) there appears to be no Go code under $GOROOT containing
parenthesized literal types. Furthermore, parentheses are never needed around a
literal type for correct parsing.

R=golang-dev
CC=golang-dev
https://golang.org/cl/1913041
2010-07-29 18:13:41 -07:00
Andrew Gerrand
88fc337fa2 spec: add recover to predeclared identifiers list
R=gri
CC=golang-dev
https://golang.org/cl/1894043
2010-07-27 15:03:30 +10:00
Robert Griesemer
dc60c5a7ec go spec: clarification of channel close()
R=r, rsc
CC=golang-dev
https://golang.org/cl/1766042
2010-07-14 16:09:22 -07:00
Rob Pike
041d11623f Go specification: Lock down some details about channels and select:
- nil channel in regular send or receive panics
- empty select blocks forever

R=rsc, gri, iant, ken2
CC=golang-dev
https://golang.org/cl/1825043
2010-07-13 16:23:54 -07:00
Robert Griesemer
0c2e6b3637 go spec: specify len/cap for nil slices, maps, and channels
Fixes #891.

R=r, rsc
CC=golang-dev
https://golang.org/cl/1760043
2010-07-13 11:54:57 -07:00
Robert Griesemer
73ca127e67 go/spec: fix typo
R=r
CC=golang-dev
https://golang.org/cl/1790041
2010-07-09 13:02:54 -07:00
Russ Cox
f4429181df spec: restrict when len(x) is constant
R=gri, iant, ken2, r
CC=golang-dev
https://golang.org/cl/1687047
2010-07-01 17:49:47 -07:00
Russ Cox
e495351ff7 spec: struct tags must be identical for types to be identical
We didn't mention this explicitly during our discussions,
but I think it fits the "identical types are spelled identically"
rule that we used.

R=gri, iant, ken2, r, rsc1
CC=golang-dev
https://golang.org/cl/1698043
2010-06-21 12:42:33 -07:00
Russ Cox
9562592342 spec: remove ... (keeping ...T)
R=gri, iant, ken2, r, r2
CC=golang-dev
https://golang.org/cl/1632041
2010-06-12 11:37:13 -07:00
Rob Pike
db8c2b1803 spec: clarify that result parameters are always zeroed before the function executes.
R=golang-dev
CC=golang-dev
https://golang.org/cl/1641043
2010-06-11 21:30:03 -07:00
Robert Griesemer
440cc95470 go spec: rename "assignment compatible" -> "assignable"
R=r, rsc
CC=golang-dev
https://golang.org/cl/1590041
2010-06-07 17:40:21 -07:00
Robert Griesemer
7bc03718f4 go spec: clean-up and consolidation of spec with implementation
Specifically:
- introduced notion of "underlying type"
- removed notion of type compatibility
- consolidated rules about assignment compatibility in
  assignment compatibility section
- be consistent with specyfing that nil is the value
  for uninitialized variables that can be nil (this
  was not specified clearly for pointers, functions, interfaces)
- added/fixed various related links throughout
- clarify language on conversions

R=rsc, r, iant, ken2
CC=golang-dev
https://golang.org/cl/1536041
2010-06-07 15:49:39 -07:00
Robert Griesemer
1d282a8eb2 go spec: Base comparison compatibility on assignment compatibility.
Specifically:
- Simplified definition of comparison compatibility and folded into
  section on comparison operators since it's only used there.

This is a small language change/cleanup. As a consequence:
- An interface value may now be compared against a non-interface value.
- Channels with opposite directions cannot be compared directly anymore
  (per discussion with rsc).

R=rsc, r, iant, ken2
CC=golang-dev
https://golang.org/cl/1462041
2010-06-03 16:55:50 -07:00
Robert Griesemer
63f014910d go spec: change def. of "type compatibility" to be non-recursive
and adjust conversion rules.

Also:
- clarification of type identity (no language change)
- adjust special rules for channel assignment/comparison to
  require identical element types (in correspondence to non-
  recursiveness of type compatibility)

R=rsc, iant, ken2, r
CC=golang-dev
https://golang.org/cl/1376042
2010-05-28 14:17:30 -07:00
Robert Griesemer
31f2503cde go spec: Disallow &a notation to obtain a slice
from an array; one needs to write a[0:] instead.

R=rsc, r, iant, ken2
CC=golang-dev
https://golang.org/cl/1365041
2010-05-27 17:23:25 -07:00
Evan Shaw
67d30bb696 spec: Fix link to fallthrough statements
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/1303041
2010-05-25 18:24:07 -07:00
Robert Griesemer
c7e03a32b3 go spec: minor fix, to match conversion rules 4 and 5
R=rsc
CC=golang-dev
https://golang.org/cl/1270042
2010-05-24 21:25:01 -07:00
Robert Griesemer
934a520d75 go spec: fix and clarify syntax of conversions
Fixes #803.

R=rsc, r, iant, ken2
CC=golang-dev
https://golang.org/cl/1281041
2010-05-24 14:58:26 -07:00
Russ Cox
e7561de09a spec: index of non-addressable array is not addressable
Motivated by:

func f() []int
func g() [10]int

f()[1] = 1  // ok
g()[1] = 1 // ERROR

R=gri
CC=golang-dev
https://golang.org/cl/1278041
2010-05-24 14:31:43 -07:00
Evan Shaw
cb4e9f8508 spec: Fix a code tag
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/1266042
2010-05-23 11:21:47 -07:00
Robert Griesemer
3af4803704 go spec: added imaginary literal to semicolon rules (was missing)
- also added links to the respective sections
- reformatted section for better (source html) readability
- added missing closing </li>'s in many places

R=r
CC=golang-dev
https://golang.org/cl/1220041
2010-05-14 13:11:48 -07:00
Robert Griesemer
56ca697269 go spec: simplify section on channel types
R=rsc, iant, r
CC=golang-dev
https://golang.org/cl/1171041
2010-05-07 18:22:40 -07:00
Robert Griesemer
df674ffb43 go spec: clarification of make arguments,
specification of runtime exceptions for
make and division by zero

R=r, rsc, ken2, iant
CC=golang-dev
https://golang.org/cl/1081041
2010-05-04 17:31:40 -07:00
Robert Griesemer
39f009cb8e go spec: fix iota description
R=r, rsc
CC=golang-dev
https://golang.org/cl/946046
2010-04-29 10:57:27 -07:00
Rob Pike
de92199648 spec: clarify "continue" with label. the text was obvious in intent but
inaccurate in meaning.

R=gri
CC=golang-dev
https://golang.org/cl/964045
2010-04-28 13:18:40 -07:00
Robert Griesemer
f5b3c14f31 go spec: fix wrong comment
Fixes #743.

R=r, rsc
CC=golang-dev
https://golang.org/cl/944044
2010-04-27 17:52:44 -07:00
Evan Shaw
21110c799d spec: Fix run-time panic header id
Everything was linking to "Run_time_panics", but the id was "Run_time_errors".

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/961042
2010-04-22 10:14:53 -07:00
Russ Cox
6aad41919b go_spec updates
R=r, iant
CC=golang-dev
https://golang.org/cl/921041
2010-04-13 20:55:57 -07:00
Joe Poirier
d37e87c1b2 gp_spec typo fix: code example in the "Handling panics" section
R=rsc, adg
CC=golang-dev
https://golang.org/cl/881047
2010-04-08 10:25:57 +10:00
Robert Griesemer
d4a1619733 go spec: correct clarification of type declaration
R=rsc, r
CC=golang-dev
https://golang.org/cl/855043
2010-04-01 12:48:34 -07:00
Robert Griesemer
735e00d4a0 go spec: clarification of type declarations
R=r, rsc
CC=golang-dev
https://golang.org/cl/849044
2010-03-31 16:37:22 -07:00
Robert Griesemer
e8e4987ba3 godoc: support for title and subtitle headers when serving .html docs
and use it to show version (date) of go spec

Fixes #68.

R=rsc
CC=golang-dev, r
https://golang.org/cl/848042
2010-03-30 17:37:42 -07:00
Andrew Gerrand
10b77f7a2b spec: typo in switch sample code, missing semicolon
Fixes #697

R=r
CC=golang-dev
https://golang.org/cl/804042
2010-03-29 13:12:08 +11:00
Russ Cox
97d0e8fe6c gc: allow taking address of out parameters
Fixes #186.

R=ken2
CC=golang-dev
https://golang.org/cl/793041
2010-03-26 18:01:02 -07:00
Rob Pike
5bb29fb116 spec changes for panic and recover.
R=rsc, gri
CC=golang-dev
https://golang.org/cl/763041
2010-03-25 17:59:59 -07:00
Rob Pike
bf9b8f2c17 Delete panicln from the spec.
R=rsc, gri, iant, ken2
CC=golang-dev
https://golang.org/cl/738041
2010-03-24 15:17:00 -07:00
Robert Griesemer
48f0cd2bd5 go spec: modification of defer statement
R=r, rsc, ken2, iant
CC=golang-dev
https://golang.org/cl/708041
2010-03-23 17:30:14 -07:00
Robert Griesemer
29f1ca528b Go spec: map indexing never raises a runtime exception.
Also: Actual map key must be assignment-compatible with
formal map key type.

Fixes #357.

R=r, iant, rsc, ken2
CC=golang-dev
https://golang.org/cl/673042
2010-03-23 14:01:51 -07:00
Ian Lance Taylor
11a218444f Revert previous change: complexN only converts to complexN.
This was discussed with Ken and Russ.  6g has been changed,
and both compilers now work this way.  This avoids a double
type conversion--first to the float type, then to the complex
type.

R=r
CC=golang-dev, ken2, rsc
https://golang.org/cl/419042
2010-03-10 20:38:38 -08:00
Robert Griesemer
ef4c2b85a0 go_spec.html: fix typo and link
R=r
CC=golang-dev
https://golang.org/cl/382045
2010-03-10 15:29:36 -08:00
Ian Lance Taylor
18187e7d49 Complex values may only be compared for equality or inequality.
R=gri, r
CC=golang-dev
https://golang.org/cl/294042
2010-03-08 14:05:46 -08:00
Ian Lance Taylor
5cf707b499 Clarify that conversions to complex are OK.
R=r
CC=golang-dev
https://golang.org/cl/296042
2010-03-08 13:45:03 -08:00
Rob Pike
7297087101 Spec for complex numbers
R=rsc, ken2, gri, iant
CC=cw, golang-dev
https://golang.org/cl/227041
2010-03-04 12:35:16 -08:00
Robert Griesemer
f42e8833b3 language spec: make NUL byte rule an implementation restriction
R=rsc, r, iant, ken2
CC=golang-dev
https://golang.org/cl/211041
2010-02-17 15:50:34 -08:00
Russ Cox
b7d9ffeecd spec: disallow NUL in source files
R=r
CC=golang-dev
https://golang.org/cl/209042
2010-02-16 16:47:18 -08:00
Rob Pike
1811fac7cb specification of []int(string) and []byte(string).
also clarify other string conversions.

R=rsc, iant, gri, ken2
CC=golang-dev
https://golang.org/cl/207103
2010-02-17 11:26:09 +11:00
Rob Pike
810def8484 ...T is now implemented
R=rsc, gri
CC=golang-dev
https://golang.org/cl/198050
2010-02-01 18:59:23 -08:00
Rob Pike
22a4952bd2 note that ...T is not yet implemented.
R=rsc
CC=golang-dev
https://golang.org/cl/194114
2010-01-27 13:45:16 -08:00
Rob Pike
b81065d07f add definition of new parameter style
... T
for trailing arguments of type T.

R=rsc, gri, ken2, iant
CC=golang-dev
https://golang.org/cl/194100
2010-01-27 13:14:40 -08:00
Robert Griesemer
1c369bd55f Clarify parsing of channel types.
R=r, rsc
CC=golang-dev
https://golang.org/cl/194091
2010-01-27 09:35:39 -08:00
Russ Cox
46871692c2 spec: allow func() func().
no longer ambiguous at top level, thanks to new semicolon rules.

use gofmt layout for function types.

Fixes #528.

R=gri
CC=golang-dev
https://golang.org/cl/194077
2010-01-26 10:25:56 -08:00
Rob Pike
3909b6b479 log.Fatal does not exist. Use log.Crash.
R=rsc
CC=golang-dev
https://golang.org/cl/193075
2010-01-25 07:48:31 +11:00
Russ Cox
16205a3534 spec: mention Inf and NaN are supported at run time.
add hyperlink at mention of package reflect.

Fixes #438.

R=r
CC=golang-dev
https://golang.org/cl/190042
2010-01-18 15:59:14 -08:00
Ian Lance Taylor
ae13f43810 Clarify when expressions are evaluated for a range clause.
R=gri, rsc
CC=golang-dev
https://golang.org/cl/189057
2010-01-13 12:50:45 -08:00
Rob Pike
632a98592d fix typo found by kevin ballard
R=gri
CC=golang-dev
https://golang.org/cl/186113
2010-01-13 12:06:33 +11:00
Rob Pike
7ec0856f01 fix typo
R=gri, iant
CC=golang-dev
https://golang.org/cl/183160
2010-01-09 07:32:26 +11:00
Robert Griesemer
30e5ed249d remove reference to "basic literal" since it's never defined
R=rsc, r
CC=golang-dev
https://golang.org/cl/183113
2010-01-04 17:28:02 -08:00
Robert Griesemer
eb109a765d Clarify section on tokens.
Fixes #457.

R=r
CC=golang-dev
https://golang.org/cl/181083
2009-12-28 14:40:42 -08:00
Russ Cox
c1045db1d8 go_spec: use PrimaryExpr as type switch expression
Without this change, the spec parses <-c.(type) as (<-c).(type)
but parses <-c.(int) as <-(c.(int)).

With this change, the former parses as <-(c.(type)).

All three parsers already implement this rule, because
they look for the "type" word during parsing of a standard
type assertion.  This change merely brings the
spec in line with the implementations.

http://code.google.com/p/go/source/browse/src/cmd/gc/go.y#801
http://code.google.com/p/go/source/browse/src/pkg/go/parser/parser.go#900
http://gcc.gnu.org/viewcvs/branches/gccgo/gcc/go/parse.cc?revision=155389&view=markup#l2469

Pointed out by Brett Kail on golang-nuts.

R=gri
CC=golang-dev
https://golang.org/cl/182044
2009-12-23 13:48:44 -08:00
Robert Griesemer
130ac74010 Spec modified to reflect new semicolon rules.
R=rsc, r, iant, ken2
CC=golang-dev
https://golang.org/cl/166066
2009-12-10 16:43:01 -08:00
Russ Cox
2a5f0c67ca spec: document that built-ins cannot be used as func values
R=gri
CC=golang-dev
https://golang.org/cl/164088
2009-12-04 10:23:12 -08:00
Ian Lance Taylor
ccd026486a Add copy to the list of predeclared functions.
R=gri
https://golang.org/cl/164081
2009-12-02 13:26:39 -08:00
Robert Griesemer
e919275825 Integrated feedback by Ken.
Easy stuff in this round, more to come.

R=iant, rsc, r, ken2
https://golang.org/cl/163058
2009-12-01 16:15:53 -08:00
Fazlul Shahriar
330139e3f2 Fix typo in spec
R=golang-dev, rsc
https://golang.org/cl/164052
2009-11-30 21:23:58 -08:00
Rob Pike
ff6a8fd779 mention arrays of arrays and slices of slices
Fixes #113.

R=gri, rsc
CC=golang-dev
https://golang.org/cl/159049
2009-11-20 15:47:15 -08:00
Robert Griesemer
1a8ebcc4b8 Allow optional second expression in slice expressions.
Built-in function copy.
Addresses issue 203.

R=rsc, r, iant
https://golang.org/cl/156089
2009-11-18 19:15:25 -08:00
Robert Griesemer
d3b1565716 - Clarify that struct composite literal keys are field names not selectors.
- Slight re-phrasing of struct type section since "field name" was not
properly introduced.

Fixes #164.

R=r, rsc, iant
https://golang.org/cl/155061
2009-11-16 08:58:55 -08:00
Robert Griesemer
0660d243b1 Use ElementType consistently.
Fixes #173.

R=r, rsc, r1
https://golang.org/cl/154156
2009-11-15 17:42:27 -08:00
Robert Griesemer
13ad5d40c4 Use // to start comment instead of #.
Fixes #189.

R=r
CC=rsc
https://golang.org/cl/155055
2009-11-15 11:33:20 -08:00
Rob Pike
9549eeecd1 add a paragraph about semicolons to the tutorial.
fix a typo caught by kakugawa@gmail.com

Fixes #92.

R=rsc
CC=golang-dev
https://golang.org/cl/152105
2009-11-12 14:10:16 -08:00
Rob Pike
cf16443c69 fix a couple of typos.
add a mention of range to the tutorial.
change tutorial's title.

R=rsc
CC=golang-dev
https://golang.org/cl/152098
2009-11-12 11:05:20 -08:00
Rob Pike
0b4de7aa8a comment out red TODO clauses except for the last one
R=rsc
CC=go-dev
http://go/go-review/1024037
2009-11-09 16:09:57 -08:00
Robert Griesemer
fb5fce5532 fix for incorrect composite literal grammar
(issue found by ken)

R=go-dev, rsc
http://go/go-review/1025030
2009-11-09 12:35:56 -08:00
Rob Pike
4fe4192ac9 fixes to spec. mostly minor but several of significance.
- carriage return is white space
- "" strings cannot span newlines
- f(g()) is ok if g is multivalue and matches f's args

R=rsc, gri
CC=go-dev
http://go/go-review/1024017
2009-11-07 22:00:59 -08:00
Robert Griesemer
30637151c7 remove gccgo restriction with respect to blank identifiers
R=iant
CC=go-dev
http://go/go-review/1016032
2009-11-03 15:10:52 -08:00
Rob Pike
9339e0758b pdf cleanup: fix links, remove internal references.
fix link in spec.

R=rsc
CC=go-dev
http://go/go-review/1017013
2009-11-02 15:28:41 -08:00
Robert Griesemer
b691e08e2c clarify rule for channel send
R=rsc
CC=go-dev
http://go/go-review/1018002
2009-10-28 18:17:24 -07:00
Robert Griesemer
90cc4a5949 go/printer:
- handle HTML tagging via (client-installable) Stylers

go/doc:
- basic styler support
- some factoring
- ready to contain the search code (but for now excluded)

doc/style.css:
- updated

doc/go_spec.css:
- cleanup: replace deprecated uses of <font> tag with <span> tag

R=rsc
DELTA=302  (160 added, 62 deleted, 80 changed)
OCL=35973
CL=35996
2009-10-22 09:41:38 -07:00
Russ Cox
60ff8cc86f address bug193 and add note to spec about it.
R=ken
OCL=35920
CL=35920
2009-10-20 08:27:14 -07:00
Robert Griesemer
d4d4ff0d83 - method names in method sets/interfaces must be all different
- specify evaluation order of floating-point expressions as
  discussed
- specify floating point conversion rounding as discussed
- slightly reformatted section on conversions to make it
  more readable (hopefully)
- fixed production for interpreted_string_lit - components
  were not properly tagged before because of """ instead of `"`

R=go-dev
DELTA=83  (41 added, 11 deleted, 31 changed)
OCL=35864
CL=35885
2009-10-19 13:13:59 -07:00
Robert Griesemer
53440da835 Factored out boilerplate from all html docs in doc directory:
- the first HTML comment in those files is extracted as page
  title when serving them
- lib/godoc.html is top-level template for all pages served
- experimented a bit with package documentation layout
  (feedback welcome)
- various related cleanups

TODO:
- The / page (doc/root.html) content repeats links that are
  in the navigation bar. It needs to be cleaned up.

R=rsc
DELTA=826  (86 added, 692 deleted, 48 changed)
OCL=35230
CL=35245
2009-10-01 14:08:00 -07:00
Robert Griesemer
164a7bceeb - completed section on built-in functions
- moved Conversions section out of built-in functions and into expressions
- fixed syntax of conversions (parens are not mandatory if the type is not a TypeName)
  (this is the only change to the Conversions section; the rest of the text is just moved;
  old line: 4043, new line: 3078)
- fixed syntax of composite literals (parens are allowed around LiteralType)

DELTA=239  (115 added, 98 deleted, 26 changed)
OCL=35118
CL=35159
2009-09-30 12:00:25 -07:00
Rob Pike
69d13b2332 make the sidebars consistent
add Effective Go to the set of links

DELTA=166  (62 added, 57 deleted, 47 changed)
OCL=35085
CL=35089
2009-09-29 11:57:28 -07:00
Robert Griesemer
326ef13976 - assignments to structs are only legal if all struct fields are visible
- removed section on Multiple-file packages as this seems now now covered
  sufficiently elsewhere

DELTA=45  (11 added, 25 deleted, 9 changed)
OCL=35065
CL=35071
2009-09-28 19:21:15 -07:00
Russ Cox
13dac655cb disallow interface {x, y()}
R=gri
DELTA=8  (3 added, 0 deleted, 5 changed)
OCL=35045
CL=35047
2009-09-28 14:16:33 -07:00
Robert Griesemer
fc61b77754 - clarify type declaration (specifying status quo)
DELTA=68  (51 added, 8 deleted, 9 changed)
OCL=35038
CL=35046
2009-09-28 14:10:20 -07:00
Rob Pike
3aec2e46de rewrite the section about imports
DELTA=42  (10 added, 11 deleted, 21 changed)
OCL=35017
CL=35020
2009-09-25 17:00:22 -07:00
Robert Griesemer
997851e681 - reworked section on import declarations
- added missing <p> tags in various places

DELTA=62  (32 added, 4 deleted, 26 changed)
OCL=35014
CL=35014
2009-09-25 15:36:25 -07:00
Robert Griesemer
e1e7619f01 - fixed sieve.go example (channel directions were wrong)
- cosmetic adjustments

R=r
DELTA=30  (0 added, 0 deleted, 30 changed)
OCL=35010
CL=35012
2009-09-25 14:11:03 -07:00
Robert Griesemer
19b1d35d4c rewording around ideal and basic types
DELTA=355  (93 added, 85 deleted, 177 changed)
OCL=34904
CL=34998
2009-09-24 19:36:48 -07:00
Rob Pike
084577b81a hakuho
R=ken
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=34828
CL=34828
2009-09-19 11:41:26 -07:00
Robert Griesemer
d36d191e25 - added heading to operator precedence section so it's easy to find
- fixed broken link to function literals section
- minor adjustments

R=r
DELTA=20  (1 added, 3 deleted, 16 changed)
OCL=34792
CL=34794
2009-09-18 11:58:35 -07:00
Robert Griesemer
da961881b4 - silence ebnflint: mark syntax section as "ebnf" instead of "grammar"
- re-use MethodName production

R=r
DELTA=4  (1 added, 1 deleted, 2 changed)
OCL=34734
CL=34734
2009-09-17 11:01:50 -07:00
Larry Hosken
698c6c00a0 A step towards "externalizing" some Go docs.
+ style sheet: like code.google.com but less feature-ful
+ JS with table-of-contents generation
+ tweaked go_spec.html and go_mem.html to use new style+JS
+ static-HTML-ified a few other Go docs:
  + static HTML versions of some wiki pages (which I'll turn
    into links to these pages).

A notable thing that is _not_ in this changelist: any change
to the godoc tool or whatever thing generates http://go/godoc

R=r
APPROVED=r
DELTA=2472  (2307 added, 113 deleted, 52 changed)
OCL=34644
CL=34728
2009-09-17 08:05:12 -07:00
Rob Pike
9d7538b42b slight refinement of select: evaluation is top to bottom, as in switches.
DELTA=9  (2 added, 4 deleted, 3 changed)
OCL=34690
CL=34692
2009-09-16 11:49:35 -07:00
Robert Griesemer
5eb36240b7 - added syntax for conversions (was missing)
- added TODO for syntax for built-ins (require type as first argument)
- removed duplicate definition of Index

DELTA=13  (11 added, 1 deleted, 1 changed)
OCL=34668
CL=34688
2009-09-16 11:05:14 -07:00
Rob Pike
01cadde597 Deriving functions from methods
DELTA=238  (118 added, 116 deleted, 4 changed)
OCL=34653
CL=34660
2009-09-15 15:56:44 -07:00
Rob Pike
8cb9184d7f an attempt to define initialization order within a package.
DELTA=23  (19 added, 1 deleted, 3 changed)
OCL=34646
CL=34649
2009-09-15 11:56:39 -07:00
Rob Pike
678625d8df minutiae: pass 1
DELTA=174  (65 added, 10 deleted, 99 changed)
OCL=34625
CL=34639
2009-09-15 09:54:22 -07:00
Rob Pike
f3a33bca40 make SimpleStmt include EmptyStmt and the grammar simplifies a bit.
SimpleStmt was always used as an option.

fix bug: divide is a right shift

DELTA=8  (0 added, 0 deleted, 8 changed)
OCL=34612
CL=34614
2009-09-14 17:39:17 -07:00
Rob Pike
61dd8363ba correct and clarify the rules about integer conversions.
DELTA=15  (6 added, 1 deleted, 8 changed)
OCL=34549
CL=34564
2009-09-11 11:51:00 -07:00
Rob Pike
c1342802dd gccgo does not yet implement _
OCL=34517
CL=34517
2009-09-10 10:47:11 -07:00
Robert Griesemer
4e56b33b42 - blank identifier
- fixed some links

DELTA=51  (32 added, 1 deleted, 18 changed)
OCL=34497
CL=34515
2009-09-10 10:14:00 -07:00
Russ Cox
5d16d23362 update type switch to match spec.
R=ken
OCL=34471
CL=34471
2009-09-09 00:18:16 -07:00
Robert Griesemer
506c008092 cosmetic changes:
- fixed a couple of broken links
- changed some explicit section references into implicit ones

R=r
DELTA=27  (0 added, 2 deleted, 25 changed)
OCL=34461
CL=34461
2009-09-08 15:41:14 -07:00
Robert Griesemer
d3ffc5e683 silence hlint
R=r
DELTA=7  (0 added, 4 deleted, 3 changed)
OCL=34310
CL=34312
2009-09-03 10:35:09 -07:00
Russ Cox
789e58cb04 unsafe is not declared in the outermost scope
R=gri
DELTA=3  (0 added, 3 deleted, 0 changed)
OCL=34305
CL=34305
2009-09-03 09:46:24 -07:00
Stephen Ma
5db1d3867f Update restriction on declarations of methods.
APPROVED=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=34289
CL=34289
2009-09-02 20:09:25 -07:00
Robert Griesemer
237c8ab455 updated Implementation differences section
R=rsc,r
DELTA=4  (3 added, 0 deleted, 1 changed)
OCL=34204
CL=34204
2009-09-01 14:07:30 -07:00
Robert Griesemer
bdec330c85 remove leftover forward-decl syntax and example
(per feedback from Austin)

R=rsc
DELTA=7  (0 added, 2 deleted, 5 changed)
OCL=34158
CL=34161
2009-08-31 17:57:14 -07:00
Robert Griesemer
aeaab597db - use "package block" nomenclature for exported identifier section
- same capitalization for "Declarations and scope" section as for
  other sections

DELTA=23  (2 added, 1 deleted, 20 changed)
OCL=34131
CL=34156
2009-08-31 17:30:55 -07:00
Robert Griesemer
4ed666e228 doc fixes (no lang changes)
- added missing predeclared identifiers
- html-escaping of a few <<'s and >>'s
- added a few links (and removed the §'s)

R=r
DELTA=30  (0 added, 0 deleted, 30 changed)
OCL=33985
CL=33995
2009-08-27 16:45:42 -07:00
Robert Griesemer
1f95f0d353 tweaks
R=r
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=33994
CL=33994
2009-08-27 16:44:17 -07:00
Robert Griesemer
9ecd30a286 - modified type switches (replacement for CL 32659)
- takes into account new scoping rules

DELTA=52  (21 added, 7 deleted, 24 changed)
OCL=33967
CL=33982
2009-08-27 14:22:51 -07:00
Rob Pike
0262f8834d fix duplicated word
R=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=33788
CL=33791
2009-08-24 16:12:59 -07:00
Rob Pike
d55370760f allow "comma ok" in initializers
DELTA=11  (4 added, 0 deleted, 7 changed)
OCL=33698
CL=33712
2009-08-22 00:04:04 -07:00
Rob Pike
83cbca5657 rewrite type rules for expressions and add shift examples
DELTA=48  (22 added, 0 deleted, 26 changed)
OCL=33657
CL=33668
2009-08-21 14:18:08 -07:00
Robert Griesemer
ef45e64afc - unifying rules for var decls, short var decls, and assignments
DELTA=39  (4 added, 15 deleted, 20 changed)
OCL=33639
CL=33649
2009-08-21 11:25:00 -07:00
Russ Cox
8a45917f3d len and cap on chans
R=ken
OCL=33599
CL=33599
2009-08-20 11:12:04 -07:00
Russ Cox
7c4f7cc7eb introduce meaningful section names, so that
go_spec.html#Return_statements

can be used to link to spec sections.  passes hlint.
renamed final section to simply "Implementation differences"
to shorten the name, but otherwise no non-formatting changes

R=gri
DELTA=230  (10 added, 0 deleted, 220 changed)
OCL=33598
CL=33598
2009-08-20 11:11:03 -07:00
Russ Cox
fe53795422 clean up multifile package section.
remove ASCII digit comment that isn't true.

R=gri
DELTA=41  (1 added, 25 deleted, 15 changed)
OCL=33594
CL=33596
2009-08-20 10:47:40 -07:00
Russ Cox
16b95ba614 simplifications.
mark multifile section with TODO only
because that is a bigger change.

R=gri
DELTA=45  (9 added, 22 deleted, 14 changed)
OCL=33565
CL=33593
2009-08-20 10:22:52 -07:00
Robert Griesemer
0a162a1433 new scope rules
DELTA=137  (50 added, 24 deleted, 63 changed)
OCL=33476
CL=33553
2009-08-19 16:44:04 -07:00
Ian Lance Taylor
3e804ba7a7 There should not be a prohibition against embedding an
interface type in a struct.  It is meaningful and the
compilers support it.

R=gri
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=33378
CL=33384
2009-08-17 11:40:57 -07:00
Robert Griesemer
4023dce70f - remove language on forward decls
- remove language on (in-)complete types

DELTA=95  (8 added, 62 deleted, 25 changed)
OCL=33310
CL=33322
2009-08-14 17:41:52 -07:00
Robert Griesemer
4b90833803 - clarified section on return statements
- added some TODOs

DELTA=46  (15 added, 4 deleted, 27 changed)
OCL=32901
CL=32918
2009-08-07 17:05:41 -07:00
Robert Griesemer
7539c8501d language re: conversion of left operand in shift operations
DELTA=5  (5 added, 0 deleted, 0 changed)
OCL=32484
CL=32617
2009-07-31 18:05:07 -07:00
Robert Griesemer
e1b8cb8cf0 - renamed SimpleVarDecl -> ShortVarDecl, in sync with terminology used in prose
- added a few TODOs

R=r
DELTA=4  (2 added, 0 deleted, 2 changed)
OCL=31751
CL=31756
2009-07-16 20:31:41 -07:00
Robert Griesemer
7c06f285d0 capital_letter was never used
R=rsc
DELTA=2  (0 added, 1 deleted, 1 changed)
OCL=31472
CL=31477
2009-07-10 18:21:07 -07:00
Robert Griesemer
f7ac313629 - mark actual EBNF with pre-formatted class "ebnf" instead of "grammar"
- make real productions for Unicode char classes so that they can be parsed
- use `` for tokens that contain "'s or \'s so that they can be parsed
- added a missing '.'

This version of the spec passes through ebnflint (forthcoming) without errors.

R=r,rsc
DELTA=74  (3 added, 1 deleted, 70 changed)
OCL=31464
CL=31466
2009-07-10 16:06:40 -07:00
Russ Cox
ec9b0428f8 various spec tunings
R=gri
DELTA=6  (0 added, 1 deleted, 5 changed)
OCL=31415
CL=31419
2009-07-09 16:44:13 -07:00
Russ Cox
eaa92e027b Allow indexing of slice types, but not pointer to slice type.
Allow indexing of string type, but not pointer to string type.
Do not allow indexing of pointer to map type.

R=r
DELTA=18  (14 added, 0 deleted, 4 changed)
OCL=30586
CL=30754
2009-06-25 14:43:55 -07:00
Robert Griesemer
e2cb60b378 fix for conversion rule
R=rsc
DELTA=25  (10 added, 7 deleted, 8 changed)
OCL=30516
CL=30531
2009-06-19 13:03:01 -07:00
Robert Griesemer
db7a6221e9 raw strings may span multiple lines
R=r
DELTA=7  (2 added, 0 deleted, 5 changed)
OCL=30492
CL=30494
2009-06-18 13:51:14 -07:00
Robert Griesemer
cfe9211753 - removed duplicate definition of StringLit
- fixed nonsense sentence in numeric basic type section
- hlinted

R=r,rsc
DELTA=50  (10 added, 22 deleted, 18 changed)
OCL=30484
CL=30490
2009-06-18 13:29:40 -07:00
Robert Griesemer
3b576a7704 fix for incorrect type switch clause:
- nil is not a keyword
- type -> Type

R=rsc
DELTA=10  (4 added, 0 deleted, 6 changed)
OCL=30433
CL=30435
2009-06-17 14:31:33 -07:00