[Prev][Next][Index][Thread]

Re: Language question, a little bit OT




Stefan Schmiedl wrote in message <20010804195953.A27320@workhorse>...
>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 :-)


C++ is MI, but doesn't do multiple dispatch.  It does do overloading,
which is sort of like MD at compile time.

>Java and Delphi dispatch on argument types but do not support MI.


Java only does single dispatch, but also with overloading.  It
most definitely does not support MD.  Note that the difference
between message passing and single argument dispatch is
only syntax.

>Python, Perl and Ruby seem to use Smalltalks message passing
>and support single inheritance only. (Yes, I know about the module
>trick in Ruby, but that's no real MI.)
>
>Does anyone know a language with both message passing and MI?
>Or is there some fundamental reason that these two don't match?
>


Both Flavors and New Flavors supports message passing and MI.
New Flavors, in addition, supported generic functions, but only
dispatching on a single argument.

Message passing is a special case of a generic function that
dispatches on the first argument, with a distinguished syntax.
It would be easy to write a 'send' macro in Dylan to do this.





Follow-Ups: References: