spec: several clarifications to language on channels
- A channel may be used between any number of goroutines,
not just two.
- Replace "passing a value" (which is not further defined)
by "sending and receiving a value".
- Made syntax production more symmetric.
- Talk about unbuffered channels before buffered channels.
- Clarify what the comma,ok receive values mean (issue 7785).
Not a language change.
Fixes issue 7785.
Hello r@golang.org, rsc@golang.org, iant@golang.org, ken@golang.org (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to ...
10 years, 10 months ago
(2014-05-05 21:41:14 UTC)
#1
https://codereview.appspot.com/94030045/diff/120001/doc/go_spec.html File doc/go_spec.html (right): https://codereview.appspot.com/94030045/diff/120001/doc/go_spec.html#newcode1335 doc/go_spec.html:1335: <i>asynchronous</i>: communication operations succeed without blocking if the buffer ...
10 years, 10 months ago
(2014-05-06 11:45:20 UTC)
#2
PTAL https://codereview.appspot.com/94030045/diff/120001/doc/go_spec.html File doc/go_spec.html (right): https://codereview.appspot.com/94030045/diff/120001/doc/go_spec.html#newcode1335 doc/go_spec.html:1335: <i>asynchronous</i>: communication operations succeed without blocking if the ...
10 years, 10 months ago
(2014-05-06 17:20:26 UTC)
#3
PTAL https://codereview.appspot.com/94030045/diff/140001/doc/go_spec.html File doc/go_spec.html (right): https://codereview.appspot.com/94030045/diff/140001/doc/go_spec.html#newcode1284 doc/go_spec.html:1284: <a href="#Send_statements">sending</a> or On 2014/05/06 18:08:07, iant wrote: ...
10 years, 10 months ago
(2014-05-06 18:22:17 UTC)
#5
PTAL
https://codereview.appspot.com/94030045/diff/140001/doc/go_spec.html
File doc/go_spec.html (right):
https://codereview.appspot.com/94030045/diff/140001/doc/go_spec.html#newcode1284
doc/go_spec.html:1284: <a href="#Send_statements">sending</a> or
On 2014/05/06 18:08:07, iant wrote:
> s/or/and/ ?
Done.
https://codereview.appspot.com/94030045/diff/140001/doc/go_spec.html#newcode1356
doc/go_spec.html:1356: <a href="#Close"><code>close</code></a>
On 2014/05/06 18:08:07, iant wrote:
> I don't think I would put "close" on this list, as calling close on a closed
> channel will panic. While it is true that multiple goroutines can call close
on
> a channel without causing a race condition, it's not actually a reasonable
thing
> to do.
Fair enough. That said, one could have multiple goroutines that all call close
_without_further synchronization_ and that catch the potentially ensuing panic
(and thus use this mechanism to detect if the channel was closed before).
Not feeling strongly about it. Leaving for Rob.
https://codereview.appspot.com/94030045/diff/140001/doc/go_spec.html#newcode1360
doc/go_spec.html:1360: that are received by a single goroutine, the values are
received in the order sent.
On 2014/05/06 18:08:07, iant wrote:
> s/single goroutine/single other goroutine/ ?
Done.
LGTM https://codereview.appspot.com/94030045/diff/110002/doc/go_spec.html File doc/go_spec.html (right): https://codereview.appspot.com/94030045/diff/110002/doc/go_spec.html#newcode1297 doc/go_spec.html:1297: <i>bi-directional</i>. i think bidirectional is usually not hyphenated ...
10 years, 10 months ago
(2014-05-07 02:54:42 UTC)
#6
*** Submitted as https://code.google.com/p/go/source/detail?r=1ce8d70162aa *** spec: several clarifications to language on channels - A channel ...
10 years, 10 months ago
(2014-05-07 17:40:42 UTC)
#10
*** Submitted as https://code.google.com/p/go/source/detail?r=1ce8d70162aa ***
spec: several clarifications to language on channels
- A channel may be used between any number of goroutines,
not just two.
- Replace "passing a value" (which is not further defined)
by "sending and receiving a value".
- Made syntax production more symmetric.
- Talk about unbuffered channels before buffered channels.
- Clarify what the comma,ok receive values mean (issue 7785).
Not a language change.
Fixes issue 7785.
LGTM=rsc, r, iant
R=r, rsc, iant, ken
CC=golang-codereviews
https://codereview.appspot.com/94030045
Issue 94030045: code review 94030045: spec: several clarifications to language on channels
(Closed)
Created 10 years, 10 months ago by gri
Modified 10 years, 9 months ago
Reviewers:
Base URL:
Comments: 19