lambda syntax tutorial

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Thu Aug 5 04:43:52 PDT 2010


On 05/08/10 12:20, Neal Gafter wrote:
> Mautizio-
>
> Careful with the syntax.  The source fragment
>
> A<B | C>D
>
> could be either an expression or a variable declaration.  I imagine 
> that the parser now requires lookahead in code that could previously 
> have been parsed in one pass.  This is likely to be inconvenient as 
> the language is further extended.

We are aware of the problem - strange that this observation comes from 
you - who essentially proposed this syntax [1] :-)
I think that the only problem is with cast expressions (where there is 
an ambiguity between parenthesized expressions and cast to a disjunctive 
type) - I don't think an expression of that kind can occur in a context 
where a variable declarator could be expected, am I wrong?

[1] - 
http://mail.openjdk.java.net/pipermail/lambda-dev/2010-June/001485.html
>
> Cheers,
> Neal
>
> On Wed, Aug 4, 2010 at 9:47 AM, Maurizio Cimadamore 
> <maurizio.cimadamore at oracle.com 
> <mailto:maurizio.cimadamore at oracle.com>> wrote:
>
>     Hi,
>     since most of the features are available in the compiler, I took
>     the time to write a pretty basic syntax document/tutorial that
>     shows the syntax supported by the current lambda prototype. As
>     usual, the document does *not* imply that the currently
>     implemented syntax is also the final one - the aim of this
>     document is to simply help developers working with the lambda
>     prototype.
>
>     Thanks
>     Maurizio
>
>
>
>



More information about the lambda-dev mailing list