How difficult is multiple inheritance?

Stefan Matthias Aust sma at kiel.netsurf.de
Sun Jan 3 09:45:04 UTC 1999


>Stefan's note is interesting, but overlooks the two big questions in
>implementing multiple inheritance (MI):
>
>1) How do you handle multiply-inherited methods (i.e., if I inherit a method
>through more than one inheritance path, how can the user specify which one to
>use?), and

Yes, that's right. I think, this should lead to an messageAmbiguous error
which isn't detected. The inheritance graph could also have cycles and we'd
have to detected this, too. But for simplicity I ignored both points.

Using super, you can perform an "undirected resend" to use the Self term
here. For directed resends, that is, if you want to specify which of
possible ambiguous method trails to follow, you'd add a new primitive to
the VM.

>2) Do you allow multiply-defined instance variables?

No.


bye
--
Stefan Matthias Aust  //  Are you ready to discover the twilight zone?





More information about the Squeak-dev mailing list