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%2Futils%2Fmixins

-- 
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]

Reply via email to