[Gd-hackers] Chinese Dispatch for Multimethods
Bruce Hoult
bruce at hoult.org
Fri Jan 4 14:04:11 CET 2008
On Jan 5, 2008 1:20 AM, Gabor Greif <gabor at mac.com> wrote:
> We (the Dylan community) use multi-methods excessively
Hopefully Gabor means "extensively"!!
I pointed #dylan (freenode IRC) at this paper a few hours ago. Most
interesting and it would certainly make my professional life more
pleasant if this made it into C++ in the not too distant future.
Putting on my language lawyer hat (last seen in c.plus.plus on BIX in
the late 80's/early 90's), I have a couple of questions:
1) is it *required* for overriders to use the virtual keyword on each
argument, or can it be implied as it can for regular virtual
functions?
You wrote:
>A first known consideration of repeated and virtual inheritance for
multi-methods.
Dylan has *only* virtual inheritance, though it's implemented a bit
differently. Fields from base classes are included only once in an
object no matter how many times that base class is mentioned in the
inheritance graph. There is no need to offset the "this" pointer or
to have internal pointers to the one instance of a base class's fields
because field accessors are themselves virtual functions.
Of course when you're somewhere where the class of an object is known
exactly then you can use a fixed offset to access the field.
Regards,
Bruce
More information about the hackers
mailing list