arrow function syntax simplified
brendan at mozilla.com
Wed Apr 4 22:27:12 PDT 2012
Claus Reinke wrote:
> And I was surprised that both pro and cons camps continued the
> discussion of recursive self and dynamic this naming as if no
> workaround was available.
I don't think anyone is really pushing hard for a dynamic-|this| form
(say, ->) right now. Perhaps some want it but the thread here has helped
me, at least, stick to my YAGNI guns.
> To me, the ability to emulate the feature additions so closely in
> library functions suggests that some variation of fn and rec should go
> into the standard library instead of adding such features to arrow
Why wouldn't we add arrows too? There's a usability and an
efficiency/easier-optimizability case for them even with fn and rec.
> But perhaps there are reasons for
> preferring the language features over the library functions?
Your point about synthesizing dynamic-|this| given lexical-|this| forms
is good. It seems to me having fn, rec, and => is therefore best. What
am I missing?
I do suspect people won't grok fn and rec, at least not with those
names. They're very ML-ish or LISPy, not camelCaps JS-y.
More information about the es-discuss