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 >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

