Callable values: trying to summarize

Aymeric Vitte vitteaymeric at gmail.com
Mon Mar 12 04:02:35 PDT 2012


     I was not aware of this document when I wrote : 
https://mail.mozilla.org/pipermail/es-discuss/2012-March/021050.html

     Reading my post again, it's indeed not clear at all that I was 
referring more to the syntax than block lamdas's principles and that 
this should behave as block lambdas, I got this answer : 
https://mail.mozilla.org/pipermail/es-discuss/2012-March/021055.html

     Then I thought that the "do" proposals were definitely over, but 
it's not the case and I have too a preference for it.

     So, taking my examples 1 and 3 (what is the baseValue property in 
your document ? Similar to my GetBase ??), how could we do that ? (or 
please someone, just crash the idea once for all so I don't think about 
it any longer)

     The "fn" carrot for strict mode looks to be a good idea.

Le 12/03/2012 04:48, Allen Wirfs-Brock a écrit :
> see https://gist.github.com/2015544 for my current thougthts
>
> Allen
> On Mar 11, 2012, at 11:20 AM, Axel Rauschmayer wrote:
>
>> == Arrow syntax ==
>>
>> The nicest proposal I have seen has been written by David Herman:
>> https://gist.github.com/2011902
>>
>> == More traditional solution ==
>>
>> 1. Short notation for non-TCP functions: use fn; enables one to abbreviate "function" as "fn" [1]. Optional, not sure if that’s a good idea: Implicit return of completion value and lexical `this`.
>>
>> For example:
>>     use fn;
>>     arr.map(fn (x) { x * x });
>>
>> 2. Block lambdas for TCP-adhering callable blocks with lexical `this`, which previously seemed like the main contender. As a TCP-adhering syntactic alternative to block lambdas, Allen mentioned the following on Twitter:
>>     do (args) { ... }
>>
>> Open question: fn and function behaving differently seems like a bad idea, because then things are less consistent. But then you have to wonder if fn is really worth the trouble for only saving 6 characters.
>>
>>
>> [1] https://twitter.com/awbjs/status/178792012215091200
>>
>> -- 
>> Dr. Axel Rauschmayer
>> axel at rauschma.de
>>
>> home: rauschma.de
>> twitter: twitter.com/rauschma
>> blog: 2ality.com
>>
>> _______________________________________________
>> 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

-- 
jCore
Email :  avitte at jcore.fr
Web :    www.jcore.fr
Webble : www.webble.it
Extract Widget Mobile : www.extractwidget.com
BlimpMe! : www.blimpme.com



More information about the es-discuss mailing list