arrow function syntax simplified

Brendan Eich brendan at mozilla.com
Mon Apr 2 12:47:44 PDT 2012


Douglas Crockford wrote:
> On 4/2/2012 8:24 AM, Brendan Eich wrote:
>> Jorge wrote:
>>> I saw it
>>> here:<http://www.yuiblog.com/blog/2012/03/30/what-is-the-meaning-of-this> 
>>>
>>
>> Right -- I think Doug was remembering the "Harmony of My Dreams"
>> sharp-functions
>> (http://brendaneich.com/2011/01/harmony-of-my-dreams/#sharp_functions),
>> but arrows express mutable function objects per
>>
>> http://wiki.ecmascript.org/doku.php?id=strawman:arrow_function_syntax
>>
>> which is the current source of truthiness.
>>
>> I left a comment about this on the YUI blog, saw it post yesterday, but
>> it's gone now. Cc'ing Doug.
>
> It seems I misunderstood what we were agreeing to. I think the 
> (this...) form is critically important, and the immutability thing as 
> well.

We had an agreement last year in TC39 to avoid making new shorter 
function syntax implicitly freeze where the new shorter syntax falls in 
full function syntax's general body-plan. This was the impetus for the # 
prefix, which also can apply to object and array literals.

We're not going to implicitly freeze arrows. It was never in the 
strawman, or on the whiteboard during the negotiations.

I agree that leading |this| could be important for dynamic non-method 
use-cases, but those are relatively rare (let's not discount JQuery, but 
again, it could use long functions and survive). We could put 
leading-this-parameterization on the agenda for May, but we'll have to 
be careful not to lose consensus on arrows.

/be


More information about the es-discuss mailing list