[ANN] Multimethod.py -- multimethods for Python
Randall Hopper
aa8vb at yahoo.com
Tue Jan 11 14:43:44 EST 2000
Siggy Brentrup:
|Can you point us to a formal definition? Seems like you initially got into
|trouble explaining it by example :)
I don't know where to find a formal definition. Of those definitions I've
seen, I like this one best:
http://www.deja.com/=dnc/[ST_rn=ps]/getdoc.xp?AN=464888387:
|
| Multimethods support runtime polymorphism on any number of arguments.
The sentence from the paper I posted a link to says the same with more verbage:
| In object-oriented languages with multimethods (such as Common Lisp,
| Dylan, and Cecil), the appropriate method to invoke for a message send
| can depend on the run-time class of any subset of the message arguments,
| rather than a distinguished receiver argument.
Aahz Maruch:
|IOW, similar to C++-style multiple dispatch?
No, not quite.
http://www.deja.com/=dnc/[ST_rn=ps]/getdoc.xp?AN=464888387:
>
> The difference between the C++ dispatch on multiple arguments and
> languages that support 'multiple dispatch' (like Dylan) is that the
> latter languages dispatch on the run time type of the object, whilst
> the former dispatches on the compile time type of the object (except
> for the object the method is attached to).
--
Randall Hopper
aa8vb at yahoo.com
More information about the Python-list
mailing list