Allen's lambda syntax proposal

Maciej Stachowiak mjs at apple.com
Thu Dec 4 10:26:22 PST 2008


On Dec 3, 2008, at 6:30 PM, Brendan Eich wrote:

> On Dec 3, 2008, at 6:18 PM, Maciej Stachowiak wrote:
>
>> x = x
>> +x
>
> That is equivalent to
>
> x = x + x;
>
> so the case with ^ should not differ. (Were you testing in an  
> interactive REPL?)

I didn't test, I just knew this case must be disambiguated somehow and  
didn't test which way. I don't think it matters much which way, since  
you can avoid any such problems in your own code by using semicolons  
for line endings.

>
> That the case Peter showed:
>
> x = x
> ^(){}
>
> cannot be parsed as a bitwise-xor expression doesn't help in  
> general, if we do not want to mandate bottom-up parsing (we don't).

I think it would be fine for this case to be a syntax error.

Regards,
Maciej

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20081204/e82008e6/attachment.html>


More information about the Es-discuss mailing list