some generator issues
Brendan Eich
brendan at mozilla.org
Tue Apr 24 15:10:21 PDT 2007
On Apr 24, 2007, at 11:48 AM, Yuh-Ruey Chen wrote:
> I agree. If the current generator is accessed via a static method,
> then
> the same should apply to the current function accessor, especially if
> you intend to deprecate |arguments| in the future. The syntax is
> rather
> un-ES like, but if |arguments| is out of the picture, then it's better
> than introducing a new keyword.
Of course arguments is nowhere near out of the picture, and won't be
until rest params take over and old code is rewritten or retired --
which may not happen by any particular date. So I withdraw my
objection to arguments.generator on account of arguments being
frowned upon. What's the point of frowning at a brick wall?
The other reason (shadowing of arguments reducing convenience)
stands, but Generator.current is un-ES-like, I agree -- not in its
context-free syntax as in its meaning. Function.current instead of
arguments.callee would be the parallel construction. So unless
something better pops up, arguments.generator is still winning in my
view.
/be
More information about the Es4-discuss
mailing list