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

Re: Multiple dispatch / multimethods??



On Mon, 23 Jul 2001, Raffael Cavallaro wrote:

>
> On Sunday, July 22, 2001, at 10:30 PM, Gary Stephenson wrote:
>
> > Sorry, but I don't understand. I wish to compare not "overriding" (i.e.
> > inheritance) but "overloading".
>
> I think the reason you're having a problem here is that generic
> functions subsume both overriding and overloading. ...
> ...
> Maybe this helps: Generic functions are like overloading where every
> single parameter is considered when doing dispatch, and subclasses of
> the parameters will "match"  their superclass(es) for the purposes of
> dispatch. ...

Good explanations.  Something you said later about "implement a Dylan
compiler in Java" reminded me that I saw dynamic dispatch implemented in
Java, in some journal in the las year or so.  I can't remember the details
but I did a Google search for "java dynamic dispatch" and the first few
links are interesting:

www.cyberdyne-object-sys.com/oofaq2/DynInh.htm
www.cyberdyne-object-sys.com/oofaq2/DynamicDispatch.htm
www.infospheres.caltech.edu/mailing_lists/java/msg00249.html

In particular, the cyberdyne... links (a) have a good explanation and (b)
offer to sell you an implementation :-)

> An additional benefit of Dylan is run-time dispatch ...

... and one of the things pointed out in the article I read was that
dynamic dispatch in Java was *really slow* and that you'd need to do some
kind of compilation/optimisation work to make it efficient.

HTH,
Hugh

P.S.: If you try dynamic dispatch in Java, I'd be interested to know how
you'd compare the experience to trying it in Dylan :-)

-- 
Version 3.1 GCS/IT d- s+:+>+: a- C++$ UL P+ L+(++) E W++$ N++ o K++ w(++) O?
M V? PS(+) PE Y+ PGP->++ t(+) 5+(++) X(+) R tv b++ DI+ D+ G e++ h- r>++ y+
(Removed reversed spam from my email address to reply)