Thaddee Tyl wrote:
From: Brendan Eich
From: Isaac Schlueter
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.
The use of a compulsory identifier is a bright idea. Having an
identifier guarantees that we always have a function name in the stack
trace, and keeps open the possibility of recursion.
That's an independent consideration. The identifier does not help or
hurt, syntactically.
Besides, it is unambiguous,
Not without a [no LineTerminator here] restriction between the ) and {
and with that, there's no requirement for the identifier as a
disambuatiion device.
and, as I pointed out earlier, we can
still use something like "lambda".
You can call it whatever you like, but anonymous means something
different in a function expression today vs. named function expression.
Without inventing new semantics, considering only syntactic sugar, there
is no benefit to rejecting anonymous short functions.
/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss