Isaac Schlueter wrote:
On Tue, Mar 6, 2012 at 10:53, Brendan Eich <[email protected]
<mailto:[email protected]>> wrote:
This approach requires a restriction: [no LineTerminator here]
between the ) and the {:
Yes, I did put that in the OP, but it looks like my mail client
helpfully wrapped at that point, which is a bit confusing :)
No irony.
Leaving out the f in the "definition" doesn't help, since (a,b,c)
is a comma expression. The requirement is no LineTerminator
between the ) and the {.
Yes, an identifier is required. It would not be possible to define an
unnamed function in this way.
Why not express an anonymous function, though? Definition != expression.
As usual, an expression *statement* could not start with ( and consist
entirely of a function-keyword-free anonymous function expression.
Without a leading keyword, it's harder to find the functions. Not
impossible, not saying this is a deal breaker. But it is harder.
Agreed. This was inspired by seeing some code in candor and dart, and
getting jealous of their nice terse functions :) However, having not
used this style in real programs, it's hard to comment on whether it
would continue to be nice, or get annoying.
Dart has mandatory semicolons to help avoid trouble around the edges of
statements/definitions.
Candor is new, so no one has deep experience.
To get further we'd need some brave souls to try this out with a trivial
transpiler, at scale.
/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss