Optional brackets around lambda expression

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Fri Jun 17 08:26:34 PDT 2011


On 17/06/11 15:48, Bob Foster wrote:
> Maurizio Cimadamore wrote:
> >
> > Of course you can lookahead; but certain expressions, as pointed out
> > will remain ambiguous:
> >
> > process(x, y, z, a, b, c, d ->  a);
>
> Assuming parenthesis are required for multiple arguments and optional 
> for single arguments, the example has only one parse, equivalent to:
>
> process(x, y, z, a, b, c, (d) -> a);
I think we were discussing a proposed variant were parenthesis were 
optional all around (regardless of arity). If parenthesis are required 
only for arity > 1, then I agree with your analysis.

Maurizio
>
> Bob



More information about the lambda-dev mailing list