List,

haven't you heard that Smalltalk and Squeak do not directly support multiple inheritance, time and again? But that Perl, Python and Ruby do (to some extent)?
- http://www.google.com/search?q=python+ruby+multiple+inheritance

Well, that is not the case for Smalltalk since the time that VMs are implemented by using the specs of the Blue Book.

I have attached a small .st file which demonstrates that the *unchanged* VM *must* support multiple inheritance (for message sends), or else it won't work properly. It's a matter of view on what the VM does for you :-D

With the exception of support code for exceptions [pun intended] the attached examples work on VMs which implement the super send from the Blue Book.

The first example demonstrates that multiple inheritance works; in this example it is also checked that the requesting method qualifies (that the instances qualify is checked at fileIn time).

The second example does a message tally and shows that there is less than 50% overhead when possible walkbacks are guarded at every multiple inheritance message send.

The third example employs the existing method cache of the VM (the original Squeak VM) for multiple inheritance message sends and thus minimizes the overhead to less than 5% (and the demo is written in .st code :-)

Again, this all exists *unchanged* for decades. It only had to be brought to the surface?

-------

I would be very interested to see if my examples run on other platforms and VMs, please post your experience. Thank you.

It'd be equally interesting if the approach had been used before.

/Klaus

Attachment: Multiple-Inheritance.st
Description: Binary data

_______________________________________________
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners

Reply via email to