Allen's lambda syntax proposal

Mark S. Miller erights at google.com
Wed Dec 3 10:09:57 PST 2008


Despite my nostalgic longing for Smalltalk, I agree ;). But since the
purpose is to be friendlier to control abstraction patterns, it remains
important to have a *very* lightweight syntax for the no-parameter (thunk)
case. The parameter list between the ^ and the { should be optional.

Btw, I see no reason to allow a name after the ^, so I agree the name issue
by itself doesn't argue against \. But my eyes just like ^ better.

2008/12/3 Brendan Eich <brendan at mozilla.com>

> Good point -- you scored a direct hit on the Smalltalk-homage battleship
> here, IMHO.
>
> /be
>
>
> On Dec 3, 2008, at 9:11 AM, Eric Suen wrote:
>
>  In that case, you have to rewrite the grammar from:
>>
>> OptionalParameter ::= Parameter '=' NonAssignmentExpression[allowIn]
>>
>> to
>>
>> OptionalParameter ::= Parameter '=' NonAssignmentExpression[allowIn,noOR]
>>
>> Make it necessary complicated.
>>
>>  In feature(ES4), ES may have OptionalParameter, that will cause trouble
>>>>
>>>> { |a ,b = 1 | c | d | e | f }
>>>>
>>>> is
>>>>
>>>> { (|a ,b = 1 |) c | d | e | f }
>>>>
>>>> or
>>>>
>>>> { (|a ,b = 1 | c) | d | e | f }
>>>>
>>>> Regards,
>>>>
>>>> Eric Suen
>>>>
>>>>
>>> That should be a syntax error. Parenthesis should be required in that
>>> case to avoid ambiguity: {|a, b = (1 | c)| ... }
>>>
>>
>>
>> _______________________________________________
>> Es-discuss mailing list
>> Es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>>
>
> _______________________________________________
> Es-discuss mailing list
> Es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>



-- 
   Cheers,
   --MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20081203/02eb0edd/attachment.html>


More information about the Es-discuss mailing list