This is all moot now -- see meeting notes and followups. Thin arrow is not going to make it, we want one arrow. The |this| parameter for opting into dynamic rather than default-lexical |this| also died. Method definition shorthand covers the only strong use-case, as Kevin's analysis shows.

/be

Herby Vojčík wrote:
Brendan Eich wrote:
Kevin Smith wrote:

I hate the CoffeeScript deviation, though. It's just confusing for
anyone who ever learned that fat-arrow binds |this| and thin-arrow
doesn't.


True. On the other hand, "all arrows bind |this|" is also quite simple
and easy to remember.

Yes, and I kept the part of the proposal that allows |this| as a leading
arrow formal parameter, including with parameter default value. This
suggests a slight variation on the strawman, per your suggestion:

x -> { return this.x; } // lexical this for thin arrow
x => this.x // as for fat arrow

(this, x) -> { return this.x; } // dynamic this, five letter syn-tax
(this, x) => this.x // ditto for the expression-body form

I like this very much. Clear, orthogonal, readable.
It would be nice if this could get through.

/be

Herby

P.S.: Dynamic this no-arg function could also use one-arg shorthand?

this => this.x
this -> { return this.x; }

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to