Re:Google Releases JavaScript.next to JavaScript Compiler Tr...
by grayrest on Wednesday May 04, 2011 @01:37PM
(#2514588)
Brendan mentioned that he was wanting to keep # for something else and just adopt the coffeescript -> as the short form.
(x) -> x
(x) -> (x * x)
(x) -> {
for(let i = 0; i < x; i++){
console.log(i);
}
}
Was the set of syntax examples given.
I think #(a,b)a+b is somewhat ugly, but it might win because it is unambiguous and doesn't collide with existing identifier.
My favorite lambda syntax is C#'s (a,b)=>a+b, but this may be rejected because it requires lookahead to parse.