Sep 27 meeting notes
Brendan Eich
brendan at mozilla.com
Wed Sep 28 11:46:07 PDT 2011
On Sep 28, 2011, at 11:07 AM, Bob Nystrom wrote:
> On Tue, Sep 27, 2011 at 10:30 PM, Brendan Eich <brendan at mozilla.com> wrote:
> On Sep 27, 2011, at 4:06 PM, Waldemar Horwat wrote:
>
> > Trying to understand Oliver's objections to the current class proposal.
>
> Oliver objects, as do others, to "punning" (my word) declarative syntax to define object properties, and mixing static and dynamic influences. He specifically cited the location of public exportable-definitions in the constructor body, instead of in the class body.
>
> We then discussed how putting public x,y; for a class Point in the class body requires separate assignments in the constructor body.
>
> At some point, didn't we discuss borrowing a bit from CoffeeScript and supporting this shorthand:
>
> class Point {
> public x, y;
> constructor(this.x, this.y) {} // <-- assigns args to instance fields
> }
>
> If we were feeling crazy, we could go further (similar to Scala) and allow:
>
> class Point {
> constructor(public x, public y) {}
> }
>
> That gives you a declarative form, constructor argument, and initialization all in one place.
+∞
When are your edits to the proposal appearing? :-|
/be
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110928/fe51b942/attachment-0001.html>
More information about the es-discuss
mailing list