On Thu, 30 Oct 2003, Fergal Daly wrote:

> > Well, sort of.  It messes with the symbol table of the dynamically
> > constructed "child", which ends up with each parents methods.  I don't
> > really want to do that.  I want to be able to have any of the intermediate
> > classes call SUPER::foo() and have it do the right thing, which is my
> > current stumbling block.
>
> What is "the right thing"? Is it to call foo() in any other package besides
> the current one? If so this should be achievable with something like

Well, the idea is that given a set of 3 class, A, B, and C, that these can
be ordered in parent/child relationships like this:

    A
    |
    B
    |
    C
    |
   some subclass

and that you can, at the _same time_, have another subclass that inherits
from these classes like this:

    A
    |
    C
    |
    B
    |
    D
    |
   other subclass

So the "right thing" here is for SUPER::foo to call foo in the parent
that's appropriate _given the specified bottom subclass_.  Now, behind the
scenes, the implementation does not actually mess with the inheritance of
these classes at all.  So I needed a way for SUPER:: to dispatch based on
the specific subclass's expected inheritance structure.

> sub AUTOLOAD

I also wanted to avoid AUTOLOAD because I want ->can and ->isa to work
correctly.

Take a look at the implementation and tests I sent to see how this all
happens.


-dave

/*=======================
House Absolute Consulting
www.houseabsolute.com
=======================*/

Reply via email to