Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(619)

Issue 193101: code review 193101: channel types parsed not according to spec by 6g (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 5 months ago by gri
Modified:
15 years, 5 months ago
Reviewers:
CC:
r, rsc, golang-dev
Visibility:
Public.

Description

channel types parsed not according to spec by 6g

Patch Set 1 #

Patch Set 2 : code review 193101: channel types parsed not according to spec by 6g #

Patch Set 3 : code review 193101: channel types parsed not according to spec by 6g #

Unified diffs Side-by-side diffs Delta from patch set Stats (+46 lines, -0 lines) Patch
A test/bugs/bug249.go View 1 1 chunk +39 lines, -0 lines 0 comments Download
M test/golden.out View 1 1 chunk +7 lines, -0 lines 0 comments Download

Messages

Total messages: 9
gri
Hello r, rsc (cc: golang-dev@googlegroups.com), I'd like you to review this change.
15 years, 5 months ago (2010-01-26 05:15:47 UTC) #1
r2
one of the lines must be correct, the other incorrect. the incorrect one should be ...
15 years, 5 months ago (2010-01-26 05:33:18 UTC) #2
rsc
should use errchk. > channel types parsed not according to spec by 6g good test, ...
15 years, 5 months ago (2010-01-26 05:40:23 UTC) #3
gri
Elsewhere in the spec we rely on the syntax to express precedence. Also, it seems ...
15 years, 5 months ago (2010-01-26 05:47:41 UTC) #4
gri
Hello r, rsc (cc: golang-dev@googlegroups.com), Please take another look.
15 years, 5 months ago (2010-01-26 05:52:38 UTC) #5
r2
LGTM
15 years, 5 months ago (2010-01-26 05:56:24 UTC) #6
gri
*** Submitted as http://code.google.com/p/go/source/detail?r=a1eb0cc5770d *** channel types parsed not according to spec by 6g R=r, ...
15 years, 5 months ago (2010-01-26 06:10:40 UTC) #7
rsc
In the spec I see that chan ElementType is a valid channel type (the first ...
15 years, 5 months ago (2010-01-26 06:16:45 UTC) #8
gri
15 years, 5 months ago (2010-01-26 06:25:14 UTC) #9
On Mon, Jan 25, 2010 at 10:16 PM, Russ Cox <rsc@golang.org> wrote:

> In the spec I see that chan ElementType is a valid channel type
> (the first one listed, in fact), so it is valid to parse chan <- chan int
> as chan ElementType where the ElementType is <- chan int.
>

you have a point


>
> I don't know what the intent of the syntax is; I do know
> what the syntax says literally, and I don't see how to use
> it to resolve this question.  I'm not arguing against your
> proposed rule, and I'll fix 6g, but I would like to see the spec
> state the parsing precedence explicitly.  The usual precedence
> rules do not apply, because <- can be parsed either as a left-unary
> or as a right-unary operator, and that doesn't happen elsewhere in
> the language.


> I think it would suffice to add a note near the channel syntax
> that in the chan ElementType case, the ElementType cannot
> itself be a RecvChannel.
>

yes; one probably should add a couple of examples making the intent very
clear


> The flip side of the example you gave is that it's also rather odd that
>     chan int
> is parsed as
>    chan (int)
> but
>    chan <-chan int
> is parsed as
>    chan<- (chan int)
> given the same syntax.
>
> It's an odd case either way.
>
> Russ
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b