From b9f8b9c43a1b15fe5d31a80fa4873944fcd821d5 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Fri, 26 Sep 2008 13:38:38 -0700 Subject: [PATCH] - 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 --- doc/go_spec.txt | 111 +++++------------------------------------------- 1 file changed, 10 insertions(+), 101 deletions(-) diff --git a/doc/go_spec.txt b/doc/go_spec.txt index 45ce6eadd79..073772fb37b 100644 --- a/doc/go_spec.txt +++ b/doc/go_spec.txt @@ -49,6 +49,8 @@ Open issues according to gri: [ ] Do composite literals create a new literal each time (gri thinks yes) [ ] consider syntactic notation for composite literals to make them parseable w/o type information [ ] nil and interfaces - can we test for nil, what does it mean, etc. +[ ] type switch or some form of type test needed +[ ] what is the meaning of typeof() Decisions in need of integration into the doc: @@ -1343,10 +1345,6 @@ Implementation restriction: A function literal can reference only its parameters, global variables, and variables declared within the function literal. -TODO: Should a function literal return a value of the function type -instead of the pointer to the function? Seems more consistent with -the other uses and composite literals. - Primary expressions ---- @@ -1812,9 +1810,7 @@ Note that ++ and -- are not operators for expressions. Assignments ---- - Assignment = SingleAssignment | TupleAssignment . - SingleAssignment = PrimaryExpr assign_op Expression . - TupleAssignment = PrimaryExprList assign_op ExpressionList . + Assignment = PrimaryExprList assign_op ExpressionList . PrimaryExprList = PrimaryExpr { "," PrimaryExpr } . assign_op = [ add_op | mul_op ] "=" . @@ -2035,12 +2031,13 @@ Go statements ---- A go statement starts the execution of a function as an independent -concurrent thread of control within the same address space. Unlike -with a function, the next line of the program does not wait for the -function to complete. +concurrent thread of control within the same address space. PrimaryExpr +must evaluate into a function call. - GoStat = "go" Call . + GoStat = "go" PrimaryExpr . +Unlike with a regular function call, program execution does not wait +for the invoked function to complete. go Server() go func(ch chan <- bool) { for { sleep(10); ch <- true; }} (c) @@ -2597,6 +2594,7 @@ TODO: is there a way to override the default for package main or the default for the function name main.main? +