[Python-Dev] prototypes (was: Type/class)
Tim Peters
tim_one@email.msn.com
Sat, 12 May 2001 08:16:33 -0400
[Guido]
> Do prototype-based language have the equivalence of multiple
> inheritance?
Just as for class-based languages, whether a prototype-based language
supports an MI workalike varies by language. In a class-based language with
MI, a class can have multiple base classes; in a prototype-based language
with an MI workalike, an object can have multiple prototype objects. The
same kinds of ambiguities can arise, and the same kinds of resolution
strategies are applicable (imposed linearization; user-supplied
qualification; user-supplied renaming; guessing <0.7 wink>).
JavaScript is the best-known prototype language that does not support
multiple prototypes per object. A very readable intro to its object model
is here:
http://developer.netscape.com/docs/manuals/communicator/jsobj/jsobj.pdf
It's interesting because, near the end, the author explores a bit how far
you can get *trying* to fake MI in JS. The answer is "farther than you
might think", but not all the way.