Thanks for the reference!. It looks pretty complex - but I'll have to dig into the code and try it for myself....
On Jan 24, 12:06 pm, Peter Higgins <[email protected]> wrote: > Dojo's declare() is c3 mro based. > > http://svn.dojotoolkit.org/src/dojo/trunk/_base/declare.js > > The author, Eugene Lazutkin, I believe is on this list as well. > > ~phiggins > > On 1/24/11 2:59 PM, mckoss wrote: > > > > > > > > > I've been doing a lot of Python programming, and have found the > > implementation of multiple-inheritance there to be quite useful and > > expressive. Python has a concept of Method Resolution Order (MRO, or > > more specifically, C3 MRO) - you can read more about it here: > > >http://www.python.org/download/releases/2.3/mro/ > > > The gist is, that you want to ensure that sub-classes can call their > > super-classes methods in such a way that each super-class method is > > called once, and that a well defined order is specified, so that you > > never call a super-class's method before all of it's sub-classes have > > been called (another way of thinking of this is that we topologically > > sort the directed graph of super-classes). > > > I've seen some very nice treatment of single inheritance patterns for > > JavaScript, but I've not seen anyone attempt an implementation of an > > MRO-like algorithm. > > > Anyone know of any libraries that support this? If not, would anyone > > be interested in collaborating with me on an open source > > implementation of C3 MRO for JavaScript programs? > > > P.S. If you want to see how this is used in Python, here are a > > collection of classes used as "mixins" for App Engine Model classes: > > >http://code.google.com/p/pageforest/source/browse/#hg%2Fappengine%2Fu... -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
