Allen's lambda syntax proposal

Felix felix8a at gmail.com
Mon Dec 1 16:56:03 PST 2008


oh, right, forgot e4x.

ok, one objection to \(){} is that it looks
too much like a function.
in particular, it "feels like" I should write
   var a = \(x){ return x; };
but that isn't right, {||} is sufficiently
different that it "feels like" I should write
   var a = {|x| x};

Brendan Eich wrote:
> On Dec 1, 2008, at 3:47 PM, Felix wrote:
> 
>> @ is unused
>>   @(a, b, c){}
> 
> @ is already used by ECMA-357 (E4X). Also some tradition of denoting 
> dereference (Cyclone, managed C++ IIRC).
> 
> Hard to beat \ if we want the parenthesized formal parameter list in front.
> 
> /be
> 
>>
>>
>> Douglas Crockford wrote:
>>> Allen Wirfs-Brock wrote:
>>>> {|a,b,c| ...} or
>>>> \(a,b,c) {...} or
>>>> {\(a,b,c) ...}
>>>> The use of \ slightly bothers me because it is takes a character
>>> > that now is exclusively used in the lexical (token) grammar
>>> >( Unicode escapes, string escapes, line continuations)
>>> > and gives it syntactic significance. This is probably not a
>>> >fatal flaw but it would mean that the lexical uses of \ become less
>>> >visually distinctive.
>>> The language overuses / recklessly, and still it didn't die.
>>> I suppose it could survive the overuse of \ as well.
>>> Is recursion still desirable in this form. If so, then of the three I 
>>> like
>>>    \(a,b,c) {}
>>> because you can think of the \ as being an abbreviation of function.
>>>    \ name(a,b,c) {}
>>> Just don't start your function name with u.
>>> _______________________________________________
>>> 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
> 
> 


More information about the Es-discuss mailing list