Brendan Eich wrote:
Axel Rauschmayer <mailto:a...@rauschma.de>
January 19, 2012 9:31 AM
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.
First, #(params) { body } was proposed by Arv and Alex:
http://wiki.ecmascript.org/doku.php?id=strawman:shorter_function_syntax
Arv and Alex feel strongly that the shorter function syntax (anything
shortening 'function' syntax) must not freeze by default.
Well, if #(x, y) {x+y} is not good because of # is used for freezing and
freezing is not good (it is not, metadata is good argument for that),
and if something-like-lambda-block is ok, some variation of lambda-block
could be the shorter replacement for functions. These come to mind:
{*a, b* a+b}
{/a, b/ a+b}
{^a, b^ a+b}
{%a, b% a+b}
and there is still more infix operators...
maybe even {`a, b` a+b} if it does not create conflict in this context.
/be
Herby
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss