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

Re: Language question, a little bit OT



One thing I have already learned:
Don't confuse dispatching with inheritance, even if it is Saturday night :-9

From:    Scott McKay <swm@mediaone.net>
To:      To info-dylan@ai.mit.edu
Date:    2001-08-04 15:15
Subject: Re: Language question, a little bit OT

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

hmmm ... still confused ... after thinking about Michael's reply,
I have learned that:

 - multiple dispatch is selecting different methods using all arguments
 - dynamic dispatch is choosing from available methods at runtime

so you are saying that C++ does use single dispatch, i.e. only on the
first argument. I can live with that. 

Dylan and Common Lisp do multiple dispatch in this context. 
Do they do dynamic dispatch, too? I think so.

> 
> Java only does single dispatch, but also with overloading.  It
> most definitely does not support MD. 

your MD seems to coincide with my DD, yes?

> Note that the difference
> between message passing and single argument dispatch is
> only syntax.

agreed.

> >
> >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.

ok, putting them on my list for next year's new language.
As I have had no contact yet, are they in "real" use or
"just academic"?

> 
> 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.

well, spoiled by common lisp, *no* dylan macro is easy for me :-)

Stefan

-- 
Stefan Schmiedl
EDV-Beratung, Programmierung, Schulung
Loreleystr. 5, 94315 Straubing, Germany
Tel. (0 94 21) 74 01 06     Fax (0 94 21) 74 01 21
Public Key: http://xss.de/stefan.public

Change is Constant


Follow-Ups: References: