[Prev][Next][Index][Thread]
Re: Language question, a little bit OT
Stefan Schmiedl wrote:
> I just read a post by Eric Kidd on rooting all objects in a common
> ancestor, and did a mental check on the OO languages I can remember
> right now.
>
> Common Lisp and Dylan are dispatching methods according to their
> argument types and support multiple inheritance.
>
> C++ does the same, I imagine, but I don't know about multiple
> inheritance there. It's too complicated for me, just like those
> 3d-arcade games :-)
No, C++ does not do the same. Dynamic dispatch happens in C++, as well
as Java, Delphi, Python, Perl, Ruby, and Smalltalk, is only based on
the class of the object receiving the message. C++ is the only one of
the listed languages that support multiple inheritance. Some of these
languages also support static overloading where the same name can be
used for methods with different argument types. In the case of C++ this
can be used for generic programming -- with the help of some intricate
method lookup wizardry behind the scenes.
Michael
Follow-Ups:
References: