Block lambda is cool, its syntax isn't
Axel Rauschmayer
axel at rauschma.de
Thu Jan 19 09:31:55 PST 2012
>> Couldn’t one always freeze such a function shorthand and then get syntax such as:
>>
>> #(x, y) { x + y }
>
> I'm not sure what you mean. I proposed this a while ago ("Harmony of My Dreams") but we don't want frozen by design, and without the # the result is ambiguous without restricted productions, and hazardous on that account.
>
> The idea that any grawlixy preifx will do is false. Hash is wanted for consistent freeze/seal prefixing. Arrow is better and putting it at the front solves the grammar problems with arrow function syntax as current drafted.
Rationale: wouldn’t freezing by default be OK for 98% of the cases? If you want anything else, you can use a traditional function. Then the above syntax as the only function shorthand would be OK.
--
Dr. Axel Rauschmayer
axel at rauschma.de
home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120119/e09f1c45/attachment-0001.html>
More information about the es-discuss
mailing list