simple shorter function syntax
Trans
transfire at gmail.com
Fri Jul 23 10:08:37 PDT 2010
Hi--
I was reading about the proposed shorter function syntax on the wiki
and want to comment on it.
http://wiki.ecmascript.org/doku.php?id=strawman:shorter_function_syntax
I do not see how it is advantageous to using a special symbol, '#'.
Taking the example.
[0, 1, 2, 3].map( #(x) {x * x} )
If the goal is just to be more concise, what is wrong with 'f' as an
abbreviation of 'function'?
[0, 1, 2, 3].map( f(x) {x * x} )
Or 'fn', if it seems a little clearer.
[0, 1, 2, 3].map( fn(x) {x * x} )
Heck you could even use 'y' as an upside down lambda if you wanted.
[0, 1, 2, 3].map( y(x) {x * x} )
Any of these seem a much nicer choice than '#', IMHO.
More information about the es-discuss
mailing list