transparent lambda
Peter Levart
peter.levart at gmail.com
Thu Jan 7 16:10:53 PST 2010
On Friday 08 January 2010 00:04:53 Neal Gafter wrote:
> > Actually, I think it's better to regard it as the same syntax in both
> > places.
>
> I don't think so. Expressions and statements should be syntactically
> distinct. For example, consider this labelled block statement followed by
> an empty statement:
>
> label : {}
> ;
>
> And now consider this expression-statement that consists of a labelled
> block expression
>
> label : {} ;
>
> how can you tell which is which?
From JLS (14.8):
ExpressionStatement:
StatementExpression ;
StatementExpression:
Assignment
PreIncrementExpression
PreDecrementExpression
PostIncrementExpression
PostDecrementExpression
MethodInvocation
ClassInstanceCreationExpression
I would not put labeled block expression in the list of possible StatementExpressions.
So the only syntactically correct interpretation of the above example would be "a labeled block statement followed by an empty statement".
Am I missing something?
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/closures-dev/attachments/20100108/4d409e7a/attachment.html
More information about the closures-dev
mailing list