4 ms·
This seem to be a "bike shed" issue where everyone have their favorite syntax. Mascara supports function(a,b)a+b. "function" is still long though, so other sugg
by olavk 16y ago
This seem to be a "bike shed" issue where everyone have their favorite syntax. Mascara supports function(a,b)a+b. "function" is still long though, so other suggestions is "#", "^", "fn", the florin-sign, "lambda" and others.
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.
- grayrest 16y agoBrendan 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.