Commit graph

4010 commits

Author SHA1 Message Date
Robert Griesemer b813ee0e44 revert QualifiedIdent to old production
R=r
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=25732
CL=25777
2009-03-05 15:01:54 -08:00
Rob Pike 811dd2584c fix an HTML glitch.
say a little more about package main.

R=rsc
DELTA=7  (4 added, 0 deleted, 3 changed)
OCL=25725
CL=25725
2009-03-04 20:39:39 -08:00
Russ Cox 5958dd6f94 Suggested tweaks up to package section.
Major ones:
* Be consistent: "numeric type" and "arithmetic operator".
* if/swtch take "simple statement" not "short variable declaration".
* There was a comment that implied for x,y := range z() might
  evaluate z() multiple times.  I deleted it.

R=r,gri
DELTA=124  (24 added, 4 deleted, 96 changed)
OCL=25706
CL=25715
2009-03-04 17:19:21 -08:00
Russ Cox 461dd9126c change Go logo to link to home page
fix grammar for forward declaration of interface, struct.

move array down next to slice.

fix type equal example for structs.

R=r,gri
DELTA=247  (122 added, 114 deleted, 11 changed)
OCL=25694
CL=25704
2009-03-04 14:44:51 -08:00
Rob Pike 337ce2220f rephrase redundancy.
R=rsc
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=25652
CL=25656
2009-03-03 16:10:15 -08:00
Russ Cox 7a5e97ba91 The final piece of the alternative to my parens proposal
(i.e., the status quo with braces in composite literals).

DELTA=20  (16 added, 0 deleted, 4 changed)
OCL=25640
CL=25646
2009-03-03 15:40:30 -08:00
Russ Cox be2edb5761 Automated g4 rollback of changelist 25024,
plus significant hand editing.

Back to T{x} for composite literals.

R=r
OCL=25612
CL=25632
2009-03-03 08:39:12 -08:00
Russ Cox e8b43190bb clarify conversions vs type guards.
allow conversions between equal types.

R=r
DELTA=15  (4 added, 4 deleted, 7 changed)
OCL=25618
CL=25630
2009-03-03 08:10:25 -08:00
Rob Pike da34bea950 redo poor example of slices.
R=rsc
OCL=25614
CL=25614
2009-03-02 20:17:12 -08:00
Rob Pike da38974c88 address most of the editorial comments through "types"
R=rsc
DELTA=41  (9 added, 4 deleted, 28 changed)
OCL=25611
CL=25611
2009-03-02 19:13:40 -08:00
Rob Pike 426335f87b delete paragraph about unimplemented select-on-type feature.
change () to {} in all composite literals

DELTA=20  (0 added, 7 deleted, 13 changed)
OCL=25604
CL=25606
2009-03-02 17:52:52 -08:00
Rob Pike 4659685b8f Packages.
DELTA=170  (73 added, 21 deleted, 76 changed)
OCL=25556
CL=25594
2009-03-02 16:17:29 -08:00
Rob Pike 96750f130c most of the rest.
only the package section is untouched.

R=gri
DELTA=542  (186 added, 70 deleted, 286 changed)
OCL=25485
CL=25532
2009-02-27 16:47:48 -08:00
Rob Pike df3183f528 finish types.
expressions.  (they were in pretty good shape; mostly cosmetic and HTML edits)

R=gri
DELTA=655  (226 added, 97 deleted, 332 changed)
OCL=25459
CL=25481
2009-02-26 16:37:23 -08:00
Robert Griesemer f88c6c136c fixed a typo
R=r
DELTA=1  (0 added, 0 deleted, 1 changed)
OCL=25449
CL=25449
2009-02-25 16:58:57 -08:00
Rob Pike 8f2330dd7a Continue editing types section.
Do a little work polishing the "zero value" discussion.

R=gri
DELTA=486  (129 added, 120 deleted, 237 changed)
OCL=25392
CL=25444
2009-02-25 16:20:44 -08:00
Rob Pike cdbf619750 complete types
R=gri
DELTA=29  (0 added, 12 deleted, 17 changed)
OCL=25388
CL=25391
2009-02-24 17:47:45 -08:00
Rob Pike a49305df1d text and formatting are now folded into go_spec; delete
OCL=25292
CL=25383
2009-02-24 15:18:21 -08:00
Rob Pike 5af7de3fe3 Updated the section on Types.
Moved assignment compatibility to its own small section. Although most rules are type-specific,
some are not and it reduces redundancy to combine them.
Also, more experimentally, wrote a section on comparison compatibility.

R=gri
DELTA=382  (125 added, 122 deleted, 135 changed)
OCL=25355
CL=25382
2009-02-24 15:17:59 -08:00
Rob Pike a9ed30ff37 Move Types before Declarations and Scopes.
This is the only change in this CL: only rearrangement, no content change, so subsequent edits will be easier to understand.

R=gri
OCL=25353
CL=25353
2009-02-23 19:26:07 -08:00
Rob Pike f27e9f072d Work on declarations, unsafe, alignment.
Change <tt> to <code>

R=gri
DELTA=664  (222 added, 189 deleted, 253 changed)
OCL=25294
CL=25352
2009-02-23 19:22:05 -08:00
Rob Pike ce2bc3aabc add logo to documentation directory.
R=rsc
OCL=25293
CL=25293
2009-02-22 15:39:50 -08:00
Russ Cox 82c38cf8dd draft of memory model.
R=tgs
DELTA=545  (545 added, 0 deleted, 0 changed)
OCL=25212
CL=25268
2009-02-20 15:35:20 -08:00
Rob Pike ff70f09d27 Rewrite lexical section.
Put grammar productions into a box with a separate background color.

R=gri
DELTA=397  (132 added, 49 deleted, 216 changed)
OCL=25235
CL=25258
2009-02-20 13:36:14 -08:00
Rob Pike fd1f3830c1 autogenerate the table of contents
R=rsc
DELTA=149  (1 added, 145 deleted, 3 changed)
OCL=25231
CL=25234
2009-02-19 19:49:56 -08:00
Rob Pike 4501d348e8 Fix most HTML errors.
Cut introduction.
Start rewrite.

R=gri
DELTA=201  (20 added, 118 deleted, 63 changed)
OCL=25226
CL=25229
2009-02-19 17:31:36 -08:00
Robert Griesemer c2d5586c76 go_spec.txt formatted in html.
No textual changes except for html formatting.
Seems like a fine intermediate step.

R=r
DELTA=7638  (4079 added, 3559 deleted, 0 changed)
OCL=25211
CL=25224
2009-02-19 16:49:10 -08:00
Rob Pike 3d50b1e0e8 Finish the lexical section.
DELTA=176  (172 added, 0 deleted, 4 changed)
OCL=25182
CL=25222
2009-02-19 16:20:00 -08:00
Rob Pike d1107adb52 First piece of Go reference manual.
R=ken,gri,rsc
DELTA=185  (185 added, 0 deleted, 0 changed)
OCL=25133
CL=25169
2009-02-18 15:39:51 -08:00
Russ Cox 9f8f2e6130 convert composite literals from { } to ( ).
only non-trivial changes are in
	convlit1.go
	golden.out

R=gri
OCL=25019
CL=25024
2009-02-13 14:48:32 -08:00
Robert Griesemer 6f8df7aa3e - syntax for composite literals use () instead of {}
- do not permit + for array concatenation anymore
  (not implemented and not a good idea)
- document that unsafe function results are compile time constants
- fixed minor typos

DELTA=41  (7 added, 11 deleted, 23 changed)
OCL=24899
CL=24927
2009-02-11 21:57:15 -08:00
Robert Griesemer 38c232fe37 - language for embedded interfaces (as discussed this morning)
- fixed a syntax error

R=r
DELTA=17  (15 added, 0 deleted, 2 changed)
OCL=24876
CL=24889
2009-02-11 15:09:15 -08:00
Robert Griesemer 52c02c2d5d Added section on package unsafe:
- contains a (proposed) constant Maxalign
- contains some text re" alignment guarantees

R=ken,r
DELTA=97  (94 added, 1 deleted, 2 changed)
OCL=24791
CL=24871
2009-02-11 13:46:30 -08:00
Rob Pike 6506148850 a few small cleanups
R=rsc
DELTA=21  (2 added, 2 deleted, 17 changed)
OCL=24638
CL=24654
2009-02-08 10:17:23 -08:00
Robert Griesemer d8a764cc7e - removed todo and restriction from spec (closures)
- fixed typos, added a reminder for a todo

R=r
DELTA=23  (6 added, 4 deleted, 13 changed)
OCL=24611
CL=24615
2009-02-06 17:01:10 -08:00
Robert Griesemer 77ccfb090c making go-spec conform with 6g:
- equality of struct types requires equality of field names

DELTA=4  (0 added, 1 deleted, 3 changed)
OCL=24478
CL=24487
2009-02-05 16:11:14 -08:00
Rob Pike 6aabf31a83 a few tweaks triggered by tgs's comments
DELTA=46  (25 added, 1 deleted, 20 changed)
OCL=24342
CL=24354
2009-02-04 15:13:07 -08:00
Rob Pike 25a2b3626d needless semicolons
R=rsc
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=23967
CL=23970
2009-01-30 15:10:22 -08:00
Robert Griesemer 2b9fe0ea24 Test balloon: Changed the spec to see the implications of changing the
syntax of function types and making them "reference types" like slice,
map, and chan. First step in Russ' proposal.

DELTA=111  (32 added, 15 deleted, 64 changed)
OCL=23669
CL=23964
2009-01-30 14:48:29 -08:00
Russ Cox 4cf7711568 update go code tree to new func rules.
R=r
DELTA=367  (111 added, 59 deleted, 197 changed)
OCL=23957
CL=23960
2009-01-30 14:39:31 -08:00
Rob Pike b59dbd7fe0 rename variable at rsc's request
R=rsc
DELTA=4  (0 added, 0 deleted, 4 changed)
OCL=23896
CL=23928
2009-01-30 11:14:48 -08:00
Rob Pike 96777ea2a7 clean up server code in tutorial
R=rsc
DELTA=15  (1 added, 0 deleted, 14 changed)
OCL=23889
CL=23889
2009-01-30 10:18:58 -08:00
Robert Griesemer 7471eab96f - added missing sections on comparisons for some types
- clarified legal map key types (must support comparison)
- updated open issues/todo list

R=r
DELTA=81  (48 added, 19 deleted, 14 changed)
OCL=23580
CL=23621
2009-01-27 14:51:24 -08:00
Robert Griesemer 4a903e0b32 defer statement
R=r
DELTA=30  (26 added, 0 deleted, 4 changed)
OCL=23533
CL=23569
2009-01-27 09:29:40 -08:00
Robert Griesemer 18b05c1a8d - clarified slice index bounds rules
- clarified comparisons of interfaces, slices, maps, channels
- removed respective TODO's

R=r
DELTA=76  (42 added, 16 deleted, 18 changed)
OCL=23132
CL=23479
2009-01-26 09:34:19 -08:00
Robert Griesemer ae299f0d69 cosmetic change only:
- slightly simplified a couple of productions (CommClause, SwitchClause)
  by reordering

R=r
DELTA=5  (0 added, 0 deleted, 5 changed)
OCL=23304
CL=23323
2009-01-22 15:16:48 -08:00
Rob Pike ae05f00b46 update tutorial for new export scheme
R=ken,rsc
DELTA=101  (9 added, 0 deleted, 92 changed)
OCL=23174
CL=23188
2009-01-20 19:32:36 -08:00
Russ Cox 839a68469b delete export
TBR=r
OCL=23121
CL=23127
2009-01-20 14:40:40 -08:00
Robert Griesemer 9f4a27cbe6 - added TODO
R=r
DELTA=3  (3 added, 0 deleted, 0 changed)
OCL=23003
CL=23003
2009-01-16 15:44:08 -08:00
Robert Griesemer 1593ab6bb4 - cleanup todo list
- fixed language for arrays slightly

R=r
DELTA=81  (39 added, 25 deleted, 17 changed)
OCL=23000
CL=23000
2009-01-16 15:36:46 -08:00
Russ Cox 360962420c casify, cleanup sys
R=r
OCL=22978
CL=22984
2009-01-16 14:58:14 -08:00
Robert Griesemer 83c17606d7 - language for export via capitalized identifiers
- removed explicit "export" declarations and keyword
- fixed a few glitches and adjusted examples

(The details of what "export" mean should be clarified
in the spec, this is just so we have a working doc for
now.)

R=r
DELTA=131  (7 added, 63 deleted, 61 changed)
OCL=22753
CL=22970
2009-01-16 14:12:50 -08:00
Rob Pike 1a91b9a8a9 casify syscall and sequelae
R=rsc
DELTA=337  (0 added, 1 deleted, 336 changed)
OCL=22950
CL=22950
2009-01-16 11:36:44 -08:00
Rob Pike 293c8f8c65 casify tutorial examples
will bring document in line in a later CL, which may include revisiting some of the names

R=rsc
DELTA=58  (0 added, 0 deleted, 58 changed)
OCL=22906
CL=22908
2009-01-15 17:54:07 -08:00
Rob Pike 61f3302044 printf->Printf etc.
the raw fmt routines will be another, smaller but subtler pass.

R=rsc
DELTA=157  (0 added, 0 deleted, 157 changed)
OCL=22851
CL=22851
2009-01-15 13:48:11 -08:00
Rob Pike ef51f4baf4 restore "os" identifier to keep consistent with text.
R=presotto
OCL=22733
CL=22733
2009-01-14 08:43:32 -08:00
Rob Pike 40d5435278 update tutorial to new language.
add a section on printing
add a section on allocation

R=rsc
DELTA=500  (278 added, 15 deleted, 207 changed)
OCL=22381
CL=22456
2009-01-09 15:16:31 -08:00
Ian Lance Taylor dfc3e52310 Use make instead of new to allocate a channel.
R=r
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=22452
CL=22455
2009-01-09 15:13:26 -08:00
Robert Griesemer 91bbd6484b Adjusted language for literals:
- now have struct, array, slice, and map literals

DELTA=34  (13 added, 6 deleted, 15 changed)
OCL=22180
CL=22204
2009-01-07 09:31:35 -08:00
Rob Pike 8d21004b41 make the tutorial programs run again.
(the text still needs fixing)
add the tutorial programs to the test run.

R=rsc
DELTA=41  (6 added, 0 deleted, 35 changed)
OCL=22174
CL=22174
2009-01-06 15:49:27 -08:00
Robert Griesemer 633957bcce - documenting old "new()"
- adding "init()"
- fixing some bugs with slice documentation

DELTA=118  (45 added, 7 deleted, 66 changed)
OCL=22084
CL=22136
2009-01-06 13:23:20 -08:00
Robert Griesemer a329471ced A first attempt to capture the type changes.
Instead of trying to make open arrays look like arrays (which they aren't,
they just look like them), I decided to call them "slice types". As a result
they have value semantics, and one can really talk about what they really are.

Note:
- There are lots of missing details
- There are probably lots of mistakes

Looking for some initial feedback.

R=r
DELTA=444  (180 added, 189 deleted, 75 changed)
OCL=21769
CL=22020
2009-01-05 11:17:26 -08:00
Robert Griesemer 6ccca61510 - receiver ident may be optional
R=r
DELTA=5  (2 added, 0 deleted, 3 changed)
OCL=21508
CL=21510
2008-12-18 13:29:11 -08:00
Robert Griesemer 4d23030859 - ripped out excessively fancy way of describing grammar
in favor of explicit constructs
- simpler, clearer, and shorter overall
- no spec changes

(in retrospect it was just a (my) mistake to put it in in the first place)

R=r
DELTA=55  (13 added, 28 deleted, 14 changed)
OCL=21434
CL=21462
2008-12-17 15:39:15 -08:00
Robert Griesemer 6715358652 - Add introduction section (1 page), essentially a condensed form
of an earlier intro.
- Updated contents section.
- Removed left-over text from earlier documents.

No spec changes.

R=r
DELTA=379  (147 added, 227 deleted, 5 changed)
OCL=21312
CL=21331
2008-12-16 14:45:09 -08:00
Robert Griesemer 30a1a8c922 language for range clause
(I have deliberately left away the forms w/ := or = and
the forms with :)

R=r
DELTA=106  (44 added, 13 deleted, 49 changed)
OCL=21192
CL=21283
2008-12-16 11:38:56 -08:00
Robert Griesemer ef77c22626 - fixed minor bug in example (found by ken)
R=r
OCL=21272
CL=21272
2008-12-16 10:45:39 -08:00
Robert Griesemer 9dfb2ea7af closing a TODO:
- define integer overflow as wrap-around
- be more specific about machine representation

DELTA=54  (34 added, 7 deleted, 13 changed)
OCL=20870
CL=21070
2008-12-12 10:30:10 -08:00
Robert Griesemer 7354b864b5 Revised proposal for const/var cleanup, with
Ken's suggestion for the "iota" extension to tuples.

DELTA=171  (88 added, 57 deleted, 26 changed)
OCL=20460
CL=20544
2008-12-04 17:33:37 -08:00
Robert Griesemer 337af31781 - allow for multiple method names per function type in an interface decl.
- added some initial language with respect to exports

R=r
DELTA=95  (47 added, 31 deleted, 17 changed)
OCL=19407
CL=19426
2008-11-17 18:11:36 -08:00
Robert Griesemer a1c85ed83e Package-export proposal:
- syntax change
- missing: corresponding language

DELTA=5  (2 added, 0 deleted, 3 changed)
OCL=19221
CL=19352
2008-11-17 09:51:56 -08:00
Robert Griesemer 434c6052d8 - language to define type equality rigorously
- language for type guards
- fixed language for break statements

Also: Removed uses of "we" and replaced by impersonal language.
Minor cosmetic changes.

DELTA=237  (160 added, 34 deleted, 43 changed)
OCL=18620
CL=18800
2008-11-07 13:34:37 -08:00
Robert Griesemer 69e26bf28d - added (incomplete) section on parameter passing
- decribe passing of "..." parameters for a start

R=r
DELTA=70  (69 added, 0 deleted, 1 changed)
OCL=18503
CL=18503
2008-11-04 16:46:45 -08:00
Robert Griesemer f618f8940d - keeping track of to-do items
R=r
DELTA=15  (10 added, 3 deleted, 2 changed)
OCL=18334
CL=18336
2008-11-03 10:52:28 -08:00
Robert Griesemer 2e90e5424e - language for struct field tags
DELTA=17  (15 added, 0 deleted, 2 changed)
OCL=18177
CL=18184
2008-10-30 15:52:37 -07:00
Robert Griesemer ebf14c625d - clarified section on numeric types: platform-dependent types
are different from platform-independent types (not just aliases),
  except for byte, uint8
- added missing documentation of new(a, len, cap)
- updated todo/issues lists

DELTA=70  (24 added, 21 deleted, 25 changed)
OCL=17920
CL=18174
2008-10-30 14:50:23 -07:00
Robert Griesemer 2bfa95741f Preparation for varargs: Proposal for syntax.
DELTA=11  (7 added, 0 deleted, 4 changed)
OCL=17772
CL=17804
2008-10-24 13:13:12 -07:00
Robert Griesemer 4712165b17 - clarified that composites are values created every time they
are evaluated, removed corresponding TODO.

R=r
DELTA=5  (3 added, 1 deleted, 1 changed)
OCL=17746
CL=17751
2008-10-23 17:19:56 -07:00
Robert Griesemer 071c91bf48 First cut at incorporating anonymous fields of pointer types into the
spec.

I have deliberately removed the wording about receivers where it was
before because I think it needs to be more precise. There is a TODO.

DELTA=90  (54 added, 0 deleted, 36 changed)
OCL=17597
CL=17716
2008-10-23 12:04:45 -07:00
Robert Griesemer a6b546fe31 - be even more explicit about ideal number conversion in expressions
- added a note with respect the difference of semantics of *p++ in Go vs C

R=r
DELTA=14  (6 added, 2 deleted, 6 changed)
OCL=17455
CL=17457
2008-10-20 11:46:40 -07:00
Robert Griesemer 71696ac048 clarification of conversion rules for ideal numbers
R=r
DELTA=21  (11 added, 1 deleted, 9 changed)
OCL=17316
CL=17316
2008-10-16 15:03:22 -07:00
Robert Griesemer b5e0cc7ef5 - added language re: interface compparison using ==, !=
(seems not controversial)

R=r
DELTA=8  (3 added, 2 deleted, 3 changed)
OCL=16940
CL=16940
2008-10-10 16:34:44 -07:00
Robert Griesemer 57b34617e0 - Fixed bug in spec: PrimaryExpr is too restrictive in most places
(for instance *p was not allowed on the left side of "="). Changed
to Expression everywhere (this is too liberal, UnaryExpr is probably
good enough, but it seems funny, and we need to check semantically
anyway). This matches 6g yacc.
- Write expression syntac recursively to express evaluation order
and precedence syntactically.
- Organized open issues list, folded in stuff from todo.txt which
is now obsolete.

R=r
DELTA=108  (41 added, 52 deleted, 15 changed)
OCL=16903
CL=16910
2008-10-10 12:45:44 -07:00
Robert Griesemer 7271e048fc - added missing case for opt. semicolons (labels)
- more precise wording by having an explicit list of cases
- simplified statement list

R=r
DELTA=16  (10 added, 0 deleted, 6 changed)
OCL=16871
CL=16875
2008-10-09 20:05:24 -07:00
Robert Griesemer bbfe31238b More spec progress:
- language for selectors and array/map indices
- formal description of syntax notation used
- factor out common productions to better show
  symmetries in grammar

R=r
DELTA=113  (77 added, 13 deleted, 23 changed)
OCL=16853
CL=16865
2008-10-09 17:12:09 -07:00
Robert Griesemer aed247fdb9 - make optional semicolons explicit in grammar in all places
except in statement list, where it is expressed in words
- allow for empty import, const, type, and var decl lists inside ()'s
- fixed grammar for inc/dec statements
- added empty statement as it appears to be accepted by 6g

R=r
DELTA=75  (23 added, 21 deleted, 31 changed)
OCL=16785
CL=16785
2008-10-08 17:05:30 -07:00
Robert Griesemer 7abfcd981f - precise scope rules
- forward decls for interface and struct types
- complete & incomplete types
- optional semicolons

R=r
DELTA=216  (95 added, 15 deleted, 106 changed)
OCL=16465
CL=16687
2008-10-07 17:14:30 -07:00
Robert Griesemer 347cf67a85 - precise scope rules
- clarified naming of invisible fields
- fixed syntax of expression statements

R=r
DELTA=70  (33 added, 4 deleted, 33 changed)
OCL=16424
CL=16439
2008-10-03 14:04:28 -07:00
Rob Pike 569a107e0d Revised wording about sends.
Evaluation is done before communication starts.

R=gri
DELTA=19  (4 added, 1 deleted, 14 changed)
OCL=16357
CL=16416
2008-10-03 11:18:45 -07:00
Rob Pike cd368a259e add a little text clarifying the behavior of 'select'
R=gri
DELTA=18  (8 added, 2 deleted, 8 changed)
OCL=16356
CL=16356
2008-10-02 10:37:12 -07:00
Robert Griesemer 5e92fb20b8 Clarifications re: anonymous fields in structs:
- typename cannot refer to interface types
- clarified syntax
- added TODO re: type name issue with qualified identifiers

Changed/fixed order of operators/keywords.

R=r
DELTA=10  (3 added, 0 deleted, 7 changed)
OCL=16337
CL=16339
2008-10-01 17:21:19 -07:00
Robert Griesemer 52a548034e - exceptional conditions during expression evaluation are undefined
- "nil" for interfaces, comparison against "nil"

R=r
DELTA=38  (24 added, 5 deleted, 9 changed)
OCL=16207
CL=16211
2008-09-30 13:02:50 -07:00
Robert Griesemer c59b2a3db1 - type of array literals is always fixed array
- changed terminology from "embedded type" to "anonymous field"

R=r
DELTA=38  (7 added, 2 deleted, 29 changed)
OCL=16193
CL=16196
2008-09-30 10:57:59 -07:00
Robert Griesemer a1065faf7c - corrections and more on interface types
R=r
DELTA=35  (12 added, 13 deleted, 10 changed)
OCL=16162
CL=16164
2008-09-29 20:37:46 -07:00
Rob Pike 81672ef15b fix some typos, mostly
R=gri
OCL=16161
CL=16161
2008-09-29 20:06:48 -07:00
Robert Griesemer 1f3e842c73 Some initial language towards embedded types and methods for all types.
More to come.

R=r
DELTA=74  (47 added, 8 deleted, 19 changed)
OCL=16156
CL=16159
2008-09-29 18:41:30 -07:00
Robert Griesemer cd49927ca7 - added language about string literal concatenation
- added "..." to list of delimiters (slightly re-arranged that table)
- rename of 2 productions for more consistent naming

R=r
DELTA=20  (7 added, 1 deleted, 12 changed)
OCL=16101
CL=16103
2008-09-29 12:09:00 -07:00
Robert Griesemer 75a03a5b00 - added TODO
- changed FieldDecl production in preparation for inlined types

R=r
DELTA=6  (4 added, 0 deleted, 2 changed)
OCL=16046
CL=16046
2008-09-27 14:51:31 -07:00
Robert Griesemer 566e3b2043 - added language with respect to init() restrictions
R=r
DELTA=10  (9 added, 0 deleted, 1 changed)
OCL=16016
CL=16016
2008-09-26 16:41:50 -07:00
Robert Griesemer 133c68e9ac Simplification of Conversions section:
- leave only basic type conversions in that section
- we have a section of composite literals which covers those
- we have a section prepared (but not written) on type guards
- the built-in function "convert" doesn't need to be exposed
  as it is redundant

R=r
DELTA=101  (6 added, 77 deleted, 18 changed)
OCL=15986
CL=15991
2008-09-26 14:04:21 -07:00
Robert Griesemer b9f8b9c43a - fixed Go statement syntax (only notational change)
- simplified Assignment syntax (only notational change)
- added TODOs
- made old text invisible by moving it into HTML comment

R=r
DELTA=107  (4 added, 95 deleted, 8 changed)
OCL=15972
CL=15987
2008-09-26 13:38:38 -07:00
Robert Griesemer ac05579345 1) Fixed spec w/ respect to result types.
2) Added proposal for making "if" statements consistent with the
   other control structures.

R=r
DELTA=59  (32 added, 6 deleted, 21 changed)
OCL=15583
CL=15964
2008-09-26 11:15:14 -07:00
Ian Lance Taylor 128f052891 Correct two web links, add missing semicolon after &lt.
R=r
DELTA=3  (0 added, 0 deleted, 3 changed)
OCL=15619
CL=15624
2008-09-22 11:29:40 -07:00
Robert Griesemer b90b213e61 Updated spec:
- clarified constants and constant expressions
- clarified type of array composite literals (fixed vs open arrays)
- clarified type of map composite literals (need to use '&' to get
  a map pointer)
- added proposal for "if-else" (TBD)
- added TODO w/ respect to "x, ok = <-ch" (and for arrays)

R=r
DELTA=51  (35 added, 0 deleted, 16 changed)
OCL=15573
CL=15575
2008-09-19 15:49:55 -07:00
Robert Griesemer 6a0fb60866 - added item to TODO list in go_spec
- filed a bug

R=r
OCL=15517
CL=15517
2008-09-18 23:16:22 -07:00
Robert Griesemer 2902a82ca4 adjusted doc to incorporate new channel notation
(still a couple of TODO's with respect to the new
notation).

R=r
DELTA=71  (10 added, 11 deleted, 50 changed)
OCL=15419
CL=15443
2008-09-17 13:57:11 -07:00
Rob Pike f7a506bf42 tutorial code:
tweak a program or two
delete unused programs
add shell script to run them all

R=gri
DELTA=213  (62 added, 147 deleted, 4 changed)
OCL=15435
CL=15437
2008-09-17 12:14:52 -07:00
Rob Pike 592d2e3d8d update to new communications syntax
R=gri
OCL=15417
CL=15417
2008-09-16 19:40:38 -07:00
Rob Pike 6820196b75 section on service multiplexing
R=gri
DELTA=75  (57 added, 4 deleted, 14 changed)
OCL=15394
CL=15398
2008-09-16 13:14:44 -07:00
Rob Pike db9002f152 replace 235 with sieve - less problematic
add programs, not yet described, to demonstrate servers.

R=gri
DELTA=279  (177 added, 16 deleted, 86 changed)
OCL=15380
CL=15389
2008-09-16 11:00:11 -07:00
Rob Pike a43033a315 develop interfaces through cats
sort
2,3,5

R=gri
DELTA=648  (647 added, 0 deleted, 1 changed)
OCL=15315
CL=15352
2008-09-15 11:48:37 -07:00
Rob Pike 6693730e77 next section: i/o package that has structs, methods
R=gri
DELTA=137  (134 added, 0 deleted, 3 changed)
OCL=15251
CL=15259
2008-09-12 16:03:16 -07:00
Robert Griesemer c8e18767e8 - hopefully improved language on label scopes
R=r
DELTA=18  (12 added, 0 deleted, 6 changed)
OCL=15200
CL=15240
2008-09-12 12:26:22 -07:00
Robert Griesemer e28ccebd3a - simplified the ideal number terminology for better readability
R=r
DELTA=24  (0 added, 10 deleted, 14 changed)
OCL=15188
CL=15188
2008-09-11 18:23:28 -07:00
Robert Griesemer ad71110669 - rewrote section on numeric literals (grammar easier to read,
separate between ints and floats, added language regarding the
type of numeric literals)
- added language with respect to the scope of labels
- introduced ideal types for the purpose of the spec
- added language to expressions, operands
- added some more formal language about ideal type conversion
  (probably not 100% correct yet)

R=r
DELTA=145  (69 added, 4 deleted, 72 changed)
OCL=15165
CL=15186
2008-09-11 17:48:20 -07:00
Rob Pike c7ebfed655 add sections about types and constants
R=gri
DELTA=133  (124 added, 0 deleted, 9 changed)
OCL=15122
CL=15143
2008-09-11 10:21:02 -07:00
Rob Pike 27a56171c9 growing the tutorial
R=gri
OCL=15115
CL=15115
2008-09-10 17:11:04 -07:00
Ian Lance Taylor 203b55e319 Eliminate duplication of MethodDecl nonterminal by renaming
the one associated with interface types.

R=gri
DELTA=3  (0 added, 0 deleted, 3 changed)
OCL=15092
CL=15096
2008-09-10 13:24:47 -07:00
Robert Griesemer 667ef6c163 - incorporated bug fixes, todo's as suggested by rsc
R=r
DELTA=32  (11 added, 2 deleted, 19 changed)
OCL=15087
CL=15093
2008-09-10 13:00:32 -07:00
Rob Pike ae4123f56b - stub for tutorial
- tools to make it easy to embed programs

R=gri
DELTA=103  (97 added, 2 deleted, 4 changed)
OCL=15085
CL=15085
2008-09-10 11:46:05 -07:00
Robert Griesemer 0416f994b7 - added convenience wrappers for sort
(work now with Ken's latest compiler fix)
- exoanded test cases accordingly
- fixed a type in the spec (thx r)

R=r
DELTA=65  (62 added, 2 deleted, 1 changed)
OCL=15050
CL=15050
2008-09-09 18:13:08 -07:00
Robert Griesemer c59d2f13aa - moved spec todo's into spec (as html comment)
- cleaned up todo.txt a bit

R=r
OCL=15009
CL=15009
2008-09-09 10:48:14 -07:00
Robert Griesemer 4dc2528afa - added missing language to almost all types
- fixed several examples to use new function type syntax
- added list of open spec issues to todo.txt

R=r
DELTA=143  (88 added, 8 deleted, 47 changed)
OCL=14974
CL=15007
2008-09-09 10:37:19 -07:00
Robert Griesemer 7231ceb714 Proposal for new function type syntax as suggested by ken:
- removed "func" from function type
- make it work by changing composite literal syntax to use {} instead of ()

FunctionType is now more in line with the rest of the declarations, as the
keyword "func" is now really part of the declaration and not part of the type.

R=r,ken
DELTA=49  (14 added, 12 deleted, 23 changed)
OCL=14864
CL=14955
2008-09-08 15:01:04 -07:00
Robert Griesemer cae0342230 - \' not allowed in string literals
- \" not allowed in char literals
- replaces uses of printf with print

R=r,ken
DELTA=10  (2 added, 0 deleted, 8 changed)
OCL=14841
CL=14841
2008-09-04 16:59:31 -07:00
Robert Griesemer 41d65ac4a5 - added missing language to operator section in spec
R=r,ken
DELTA=100  (71 added, 9 deleted, 20 changed)
OCL=14827
CL=14832
2008-09-04 15:17:27 -07:00
Robert Griesemer f5cb258195 - clarification of type of array literals (always fixed array)
- clarification of const decl syntax

R=r
DELTA=9  (4 added, 0 deleted, 5 changed)
OCL=14771
CL=14771
2008-09-03 16:41:31 -07:00
Robert Griesemer ce04d0197a - fixed typo
R=r
OCL=14763
CL=14763
2008-09-03 15:22:27 -07:00
Robert Griesemer 7a4ed4f8c4 - minor corrections to go_spec.txt
- verified that all text from go_lang.txt is either present in its
  old form, or that we have corresponding updated sections for it
- delete go_lang.txt

R=r
DELTA=2389  (38 added, 2344 deleted, 7 changed)
OCL=14760
CL=14762
2008-09-03 15:15:51 -07:00
Robert Griesemer 0976e34d65 Composite literal syntax.
R=r
DELTA=25  (14 added, 2 deleted, 9 changed)
OCL=14750
CL=14753
2008-09-03 13:37:44 -07:00
Robert Griesemer 354be785c6 - removed 'iota' from the keyword list
- added missing operators

R=r
OCL=14672
CL=14672
2008-08-29 17:16:47 -07:00
Robert Griesemer df49fb3dc3 - Preliminary draft of what might become a real spec
- All text taken from go_lang.txt (which is unchanged),
but added a contents section, and sorted the contents
section in a hopefully sensible manner to give it more
structure
- Reordered text to match order of contents section,
did not adjust the language (needs to be done),
but removed sections that were dulicates or invalid

High-level organization of the doc:
- Introduction
- Notation
- Source code representation
- Vocabulary
- Declarations and scope rules
- Types
- Expressions
- Statements
- Function declarations
- Packages
- Program initialization and execution

I hope this new structure will make it much clearer which
pieces are missing and where they need to go. go_lang.txt
has grown somewhat unstructured and new text was added as
we saw fit.

R=r
DELTA=2577  (2577 added, 0 deleted, 0 changed)
OCL=14639
CL=14639
2008-08-28 17:47:53 -07:00
Robert Griesemer 2d697d67dc clarify pointer forward decls per ian's suggestion
R=r
DELTA=13  (3 added, 7 deleted, 3 changed)
OCL=14406
CL=14406
2008-08-21 17:18:01 -07:00
Robert Griesemer 2dabb6525a - explained function and method pointers
- removed need for method types and literals
(gri & r)

R=r
DELTA=178  (101 added, 51 deleted, 26 changed)
OCL=14402
CL=14405
2008-08-21 16:55:38 -07:00
Robert Griesemer c2c49bec77 added scope rules, removed TODO
R=r
DELTA=26  (19 added, 0 deleted, 7 changed)
OCL=14358
CL=14386
2008-08-21 11:00:26 -07:00
Robert Griesemer bb05942638 updated section on reserved words
R=r
DELTA=44  (27 added, 2 deleted, 15 changed)
OCL=14353
CL=14355
2008-08-20 16:32:00 -07:00
Rob Pike 9b1e6fddba fix one syntax error in declaration.
reformat the bullet list about strings

R=gri
OCL=14128
CL=14128
2008-08-12 13:21:49 -07:00
Rob Pike 68fb2d04d0 use tabs for indentation consistently
R=gri
OCL=14125
CL=14125
2008-08-12 11:38:34 -07:00
Rob Pike f97832e4c2 New words regarding constants
R=gri,ken
DELTA=64  (42 added, 3 deleted, 19 changed)
OCL=14116
CL=14124
2008-08-12 11:20:34 -07:00
Robert Griesemer fe582137f4 - removed fall-through for case: case: in switch statements
- added ()'s to all print calls in examples
- augmented rule about use of identifiers

R=r
DELTA=11  (0 added, 1 deleted, 10 changed)
OCL=14097
CL=14097
2008-08-11 18:09:31 -07:00
Robert Griesemer e3fc124640 revert specification of pointer types to current implementation
(do not allow explicit type forward declarations) and more clearly
specify resolution

R=r
DELTA=30  (9 added, 7 deleted, 14 changed)
OCL=13967
CL=13987
2008-08-07 17:15:10 -07:00
Robert Griesemer 2f4352a26d - switched most of existing Go code to new export syntax
- adjusted lang doc

R=r
DELTA=192  (26 added, 65 deleted, 101 changed)
OCL=13844
CL=13848
2008-08-04 17:17:59 -07:00
Rob Pike 84c8d85fe6 slices and string/array concatenation
OCL=13382
CL=13382
2008-07-23 11:22:30 -07:00
Rob Pike f4dcf51846 document initialization
OCL=13369
CL=13369
2008-07-22 17:53:53 -07:00
Rob Pike febbf82e8d fix some bad spaces
OCL=13363
CL=13363
2008-07-22 15:25:09 -07:00
Rob Pike 220edc48da Expand section on compound literals.
R=ken,gri
DELTA=31  (22 added, 0 deleted, 9 changed)
OCL=13351
CL=13362
2008-07-22 15:23:06 -07:00
Rob Pike c1f5eda7a2 change date
OCL=13331
CL=13331
2008-07-21 18:06:39 -07:00
Rob Pike 777ee7163b map delete
SVN=128258
2008-07-21 16:18:04 -07:00
Rob Pike 7eb7ff2b36 new channel syntax
select cleans up too

SVN=127816
2008-07-17 10:47:32 -07:00
Rob Pike 1401c11008 improve the examples in the section on iota
SVN=127347
2008-07-15 15:27:31 -07:00
Robert Griesemer 6def94ad83 - added missing keyword 'iota'
SVN=126397
2008-07-08 16:01:10 -07:00
Rob Pike c685e1b70d add a disclaimer
SVN=126379
2008-07-08 14:52:48 -07:00
Robert Griesemer 835cd46941 - first cut a Go parser in Go
SVN=126242
2008-07-07 17:27:14 -07:00
Robert Griesemer de5442893d A small but powerful change in constant declarations. Proposal by ken
after some discussion about enums. Implementation should be trivial.
Wording in the doc should be improved, probably.

SVN=125946
2008-07-03 13:19:07 -07:00
Robert Griesemer ceb01373bc - more minor fixes
SVN=125574
2008-07-01 17:18:28 -07:00
Robert Griesemer bc8ef4d526 - minor update
SVN=125471
2008-07-01 09:02:04 -07:00
Robert Griesemer 8af8dff65b - updated doc
SVN=125468
2008-07-01 08:48:24 -07:00
Rob Pike daebf91d2c fix up grammar for optional elements in if and switch conditions
SVN=122915
2008-06-16 12:02:27 -07:00
Robert Griesemer a40a79829f - fixed minor issues in spec
- fixed a couple of bugs in the spec (pointed out by iant)

SVN=122479
2008-06-12 13:12:41 -07:00
Robert Griesemer 4ff63a4794 - updated spec w/ respect to variable types and shift operators
SVN=121774
2008-06-09 16:32:49 -07:00
Robert Griesemer e92b753810 - fixed a few tests and added 3 incorrectly succeeding tests
- updated go_lang.txt to be more uniform and match the implementation
- made makehtml work on Mac
- fixed a couple of bugs in go.atg

SVN=121520
2008-06-06 15:53:14 -07:00
Robert Griesemer 896c8f4ecc - fixed a typo
SVN=120165
2008-05-27 17:09:40 -07:00
Rob Pike d4aa5c0b45 add disclaimer, authors.
preparation for linking to p page

SVN=118969
2008-05-15 17:41:39 -07:00
Rob Pike 9119f55e6d add a couple of TODOs
fixed grammar for "Program"

SVN=118923
2008-05-15 14:13:44 -07:00
Robert Griesemer aa533738c1 - changed compound type -> composite type
- eliminated 'structured type' terminology

SVN=118200
2008-05-08 21:21:09 -07:00
Rob Pike b6b8da823d fix up the 'basic types' section. strings were missing
SVN=118198
2008-05-08 20:58:15 -07:00
Rob Pike f4f588372d Clarify conversions, include making them constructors for arrays etc.
SVN=118194
2008-05-08 20:23:01 -07:00
Robert Griesemer d222c65477 Introduced forward declaration of types per discussion with ken.
A forward-declared (or not yet fully defined) type must be used
to construct (mutually) recursive type declarations. This simplifies
the compiler and resolves the issue at which scope the forward-
declared type is to be declared.

SVN=117770
2008-05-06 10:29:17 -07:00
Rob Pike f5c0763432 Explain about pointer types for mutually recursive structures.
SVN=117463
2008-05-01 23:51:33 -07:00
Rob Pike 5e391cff2c talk about short, int, long etc.
specify allowed conversions.

SVN=117458
2008-05-01 20:59:31 -07:00
Robert Griesemer d4d19fad2f Fixed a typo (changed ' -> ") and shortened a production name slightly to match the naming convention elsewhere.
SVN=117446
2008-05-01 18:47:44 -07:00
Robert Griesemer 1975ff8b44 - completed syntax for import declarations
- fixed a typo

SVN=117439
2008-05-01 18:14:17 -07:00
Rob Pike 38c083c1ca Require names for return values for functions with complex return types.
SVN=117346
2008-05-01 00:01:45 -07:00
Robert Griesemer 50cea7038b - Added section on type equivalence
- Changed signature syntax: parameter names are always mandatory
- Minor white-space cosmetic changes

SVN=117240
2008-04-29 16:27:11 -07:00
Rob Pike c1aba41194 fix description of iota to reflect reality.
SVN=117108
2008-04-28 16:19:59 -07:00
Rob Pike f53db3eaa9 Add description of type conversions.
SVN=116978
2008-04-27 18:32:47 -07:00
Robert Griesemer 1265a0c22d - essentially reverted my change of yesterday with respect to char/string syntax
- fixed indentation in many places
- fixed a couple of typos

SVN=116120
2008-04-18 15:41:59 -07:00
Robert Griesemer 75bbce9e84 - added language to document .() notation
- propose change to char/string productions: I find this easier to read

SVN=116037
2008-04-17 19:06:33 -07:00
Rob Pike a0d5d8089a Added discussion of new, nil, and initialization.
SVN=116022
2008-04-17 17:03:29 -07:00
Rob Pike b806ba4d88 Add description of how compiling and linking handle dependencies.
SVN=115807
2008-04-15 16:43:06 -07:00
Rob Pike e311457488 add script to generate .html from .txt
SVN=114148
2008-03-27 22:11:10 -07:00
Rob Pike 8c1408dd8e Add select statement
SVN=114147
2008-03-27 21:42:25 -07:00
Rob Pike e118551c29 Fix date stamp
SVN=114123
2008-03-27 17:19:52 -07:00
Rob Pike 4c483aa159 Explain goto constraints.
Add description of 'any'.
Simplify and complete syntax for literals.

SVN=114122
2008-03-27 17:19:17 -07:00
Rob Pike 67aafa6f57 update document. todo still: array and map literals; syntax for basic literals.
SVN=113815
2008-03-25 23:53:07 -07:00
Robert Griesemer 6caad961fe - added extra escaped chars
SVN=113258
2008-03-19 21:20:25 -07:00
Rob Pike e4ca60eca7 change Main, Init to lower case.
make new() take an optional expression, not expression list.
add an example for new().

SVN=112895
2008-03-17 19:05:07 -07:00
Rob Pike 65348a89b8 SVN=112717 2008-03-16 21:47:38 -07:00
Robert Griesemer e31ee76dcb - fixed typo in go_lang.txt
- changed go.atg to make optional semicolons work for statements
- expanded a test case

SVN=112242
2008-03-12 13:12:40 -07:00
Rob Pike 8152cb8a71 examples contradicted text: '\octal' and '\hex' are fixed size
SVN=112150
2008-03-11 20:40:20 -07:00
Robert Griesemer 0d1e90be17 - added 'nil' keyword to lang doc
(did not add 'true' and 'false' because I think these don't need to be
  keywords, they can be recreated from whole cloth)
- added 'new' syntax to expressions
  (this is needed because of the type as 1st argument - the expression
  list is probably not yet implemented, but I think we may want it
  eventually)
- removed optional ';'s in sieve example - make it more concise
- fixed several bugs in go.atg, no parses sieve
- added sieve as test case

SVN=112135
2008-03-11 18:07:22 -07:00
Robert Griesemer 78e4320fdc - changed if/switch initial stat syntax to match go compiler and make
it consistent
- changed declaration syntax to match go compiler

SVN=112122
2008-03-11 16:40:47 -07:00
Robert Griesemer 7acb294d58 - replaced 's in productions everywhere with "s (we were inconsistent in
some places)
- removed extra []'s around switch decl/tag expression - not needed

SVN=112117
2008-03-11 16:02:46 -07:00
Robert Griesemer 213702a3e6 - removed CompoundStat in favor of Block
SVN=112111
2008-03-11 14:37:16 -07:00
Robert Griesemer 8b212f67ff - attemp to correct statement syntax
- introduced FieldDeclList and MethodDeclList
  in consistency with other lists
- made labels declarations

SVN=111982
2008-03-10 16:23:01 -07:00
Rob Pike 2aae3fcbaf fix grammar for struct and interface types to make final semicolon optional
SVN=111810
2008-03-07 18:01:09 -08:00
Robert Griesemer e6626dafa8 - get rid of Designator terminology
SVN=111696
2008-03-06 23:06:05 -08:00
Robert Griesemer 1cf631b4c7 - added missing ''''s
SVN=111693
2008-03-06 22:40:49 -08:00
Rob Pike 194ed070de fix a few nits in the typography so HTML is right
SVN=111691
2008-03-06 22:14:17 -08:00
Robert Griesemer f27e5df49c - fixed double-definition of StructType
SVN=111689
2008-03-06 22:11:51 -08:00
Robert Griesemer b1d991d6fd - more grammar fixes
SVN=111688
2008-03-06 21:50:28 -08:00
Robert Griesemer 5009237adb - fixed a couple of grammar errors
SVN=111685
2008-03-06 21:24:57 -08:00
Rob Pike 250767174b add HTML formatting; use
/home/sanjay/bin/makehtml --mode=document go_lang.txt
to generate the html output.

SVN=111681
2008-03-06 19:40:52 -08:00
Robert Griesemer bbced02490 - updated docs
SVN=111669
2008-03-06 18:57:03 -08:00
Robert Griesemer 28590a0abb - updated docs
SVN=111539
2008-03-05 23:00:44 -08:00
Robert Griesemer 719a06fd97 - renamed todo -> todo.txt
- deleted obsolote go_spec

SVN=111358
2008-03-04 22:23:23 -08:00
Robert Griesemer 73823d236a - added new, revised spec
- updated todo

SVN=111357
2008-03-04 22:18:16 -08:00
Robert Griesemer 266b9d49bf - added language for range statement
SVN=111200
2008-03-03 23:08:28 -08:00
Robert Griesemer 328df636c5 - added language for map and channel types
- added clarifications about function types
- added open issues section

SVN=111045
2008-03-02 23:02:36 -08:00
Robert Griesemer 18c5b488a3 Go spec starting point.
SVN=111041
2008-03-02 20:47:34 -08:00