Multi-method

Jean-Marc Bourguet <jm@bourguet.org>
31 Mar 2002 23:30:46 -0500

          From comp.compilers

Related articles
Multi-method jm@bourguet.org (Jean-Marc Bourguet) (2002-03-31)
Re: Multi-method haberg@matematik.su.se (2002-04-06)
Re: Multi-method vbdis@aol.com (2002-04-06)
Re: Multi-method joachim_d@gmx.de (Joachim Durchholz) (2002-04-06)
Re: Multi-method jm@bourguet.org (Jean-Marc Bourguet) (2002-04-07)
Re: Multi-method jm@bourguet.org (Jean-Marc Bourguet) (2002-04-07)
Re: Multi-method mailbox@dmitry-kazakov.de (Dmitry A.Kazakov) (2002-04-07)
[2 later articles]
| List of all articles for this month |
From: Jean-Marc Bourguet <jm@bourguet.org>
Newsgroups: comp.compilers
Date: 31 Mar 2002 23:30:46 -0500
Organization: Compilers Central
Keywords: OOP, design, question
Posted-Date: 31 Mar 2002 23:30:46 EST

In all languages supporting OOP, there is a way to make the subroutine
called can depend on the dynamic type of one of its parameter (for
example, in C++, virtual function member). In some (CLOS comes to
mind), it is possible to make the subroutine called on the dynamic
type of several parameters.


In the first case, the use of "vtable" allows to have an efficient way
of making this dispatch, even in the context of separate compilation
(at the cost of constraining the possible types).


Is there such a technique allowing to dispatch on the type of several
parameters
        - in time proportionnal to the number of dispatching parameter
        - in such a way that independant compilation is possible.


The use of something like the visitor pattern has the first
characteristic but not the second (you have to know all the possible
types for all the dispatching parameter but one).


Yours,
--
Jean-Marc


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.