On Tue, Oct 11, 2011 at 8:11 PM, Axel Rauschmayer <[email protected]> wrote:
> *From: *Jake Verbaten <[email protected]> > *Subject: **new <Object>* > *Date: *October 11, 2011 20:53:58 GMT+02:00 > *To: *es-discuss <[email protected]> > > is there any kind of proposal for syntax that is like: > > [...] > > var o = new proto(someValue); > > > There has been a long discussion here, a few months ago. I’ve tried to > summarize it here: > http://www.2ality.com/2011/06/prototypes-as-classes.html > > The discussion ended with the following conclusion: > > - Pro: Yes, it would make things simpler. I would even argue that new-style > classes being able to extend old-style classes would be enough. Furthermore, > Python has successfully switched from one style of class to another one. > > - Contra: It would introduce a second protocol for inheritance and it would > probably not find universal acceptance (some people find > prototypes-as-classes more elegant, others like constructor functions). > Furthermore, class literals practically look and feel like > prototypes-as-classes, so that it’s a good enough solution for me. > I dont think having both new <Object> and new <Function> in the language will cause any conflicts. It's the same as claiming that having both declarative class and new <Function> would cause "confusion". class literals look the same but literal declaration are a right pain for any kind of meta programming. I can't take an existing object and turn it into a "class" without using eval. > > Axel > > -- > Dr. Axel Rauschmayer > > [email protected] > twitter.com/rauschma > > home: rauschma.de > blog: 2ality.com > > > >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

