On Nov 14, 2011, at 1:06 PM, Axel Rauschmayer wrote:

> This is the middle ground between class proponents and object exemplar 
> proponents, right?

Yes, next up is to write-up a stawman that ties all the pieces together into a 
rational story/

> 
> - Object exemplar proponents get object literal syntax, but will still have 
> to use MyClass.prototype (e.g. to add methods) after having declared a class.

or they just use the pure object exemplar pattern with the class operator:

let Point = {
     x:0,
     y,0,
     offsetBy(aPoint) {return new Point(this.x+aPoint.x, this.y+aPoint.y},  
//<---- a method
     constructor(x,y} {
         this.x=x;
         this.y=y;
     }
};


> 
> - Class proponents get syntax that looks like some of the class declaration 
> proposals, but don’t get a “proper” class construct.

I would say that we are avoiding adding any new declarations (other than let 
and const which are really all we need);  

> 
> Given that backward compatibility is a major issue, the proposal sounds 
> reasonable. It also nicely settles the syntax debates surrounding class 
> declarations. As “class declaration light”, it probably makes neither party 
> completely happy, but maybe that’s what is called for.
> 

We can't make ES into a pure class-based language such as Dart (and many 
wouldn't want to) so whatever we do has to place well with what it already 
there and also the various different abstraction styles that different 
sub-communities  have developed.  Hopefully we can  get past these debates an 
provide a good solution that uniquely builds upon the deep foundations 
JavaScript 

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

Reply via email to