Double dispatch

Jarvis, Robert P. Jarvisb at timken.com
Wed Nov 4 16:09:33 UTC 1998


I don't think DD is a language feature - it's an implementation
issue.  You can use DD in any language you like, but it seems
to be especially valuable/common in Smalltalk.

Of course my view on this is somewhat myopic as Smalltalk
is the only "real" OO language I'm familiar with (I no longer
consider C++ to be an OO language :-).

Bob Jarvis
The Timken Company

>-----Original Message-----
>From:	Lyn A Headley [SMTP:laheadle at cs.uchicago.edu]
>Sent:	Wednesday, November 04, 1998 10:36 AM
>To:	rapp at lmr.com
>Subject:	Re: Double dispatch 
>
>>>>>> "L" == L M Rappaport <rapp at lmr.com> writes:
>
>[snip double dispatch is delegation]
>
>    L> This is double dispatch - when you call Documents foreground
>    L> color, it instead goes to its instance variable and dispatches
>    L> the method there.  Now granted this is a lot of trouble to go
>
>[snip]
>
>    L> Hope this clears it up.  OTOH, if I'm full of crap, I'm sure
>    L> someone will mention it!
>
>I'm afraid I must speak up here.  I believe you are confusing
>delegation with double dispatch.  The way I understand it is that
>double-dispatch is a *language* feature which looks up the method to
>call based on the runtime type/class of *two* of its arguments rather
>than simply the first as is the case with most OO languages.  when I
>say argument I really mean the object to which the message is sent,
>but multi-dispatch languages usually use generic messages so the
>object really *is* an argument to the method.
>
>confusing, huh?  see Common lisp's CLOS for an example.
>
>
>-Lyn





More information about the Squeak-dev mailing list