Allen's lambda syntax proposal

Eric Suen eric.suen.tech at gmail.com
Sat Dec 6 18:41:58 PST 2008


But in page:

http://wiki.ecmascript.org/doku.php?id=strawman:lambdas

lambda is not just a expression, it could be a Declaration.

If lambda is only a expression, that is why I suggest in post:

https://mail.mozilla.org/pipermail/es-discuss/2008-December/008382.html

>> This is ambiguous
>>
>> {(a, b)
>> a + b}
>>
>> is
>>
>> {(a,b);
>> a+b
>> }
>
> This example isn't ambiguous, because an ExpressionStatement cannot start
> with '{', therefore this is a block. However the fact that a lambda
> starting an ExpressionStatement would have to be parenthesized is a
> valid argument against this syntax, and also against {|a, b| a+b}.
>
>> unless use no line break restrict and it is difficult to parse
>
> It's not actually difficult to parse (since an object literal cannot
> have '(' after the '{'), but I don't think it has any advantages over
> syntaxes starting with '^' or '\'.
>
>
> ('^' is back on the table given that the semicolon insertion hazard
> that caused us to be suspicious of it, already exists when a line
> starts with '(', for example.)
>
> -- 
> David-Sarah Hopwood 




More information about the Es-discuss mailing list