Right. Does that prevent an instance from being created? But it shouldn’t be hard to let a compiler perform that kind of optimization.
On Oct 10, 2011, at 13:58 , Quildreen Motta wrote: > We already get factory constructors by default -- by returning an object from > the constructor function. > > 2011/10/10 Axel Rauschmayer <[email protected]> > In many ways, Dart feels *less* versatile than ECMAScript.next. However, > there are two ideas that would make a nice addition to class literals: > > - Named constructors: Without overloading, you need a way to distinguish > constructors: > new Point.zero() > - Factory constructors: are a way to mark constructors so that no instance is > produced automatically. Then you can return cached instances or instances of > a subclasses. > > Details: http://www.dartlang.org/articles/idiomatic-dart/ > > -- > 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 > -- 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

