[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Re: On Pseudohashes



Quoting tchrist@chthon.perl.com:
:Tim, some time ago something came up about autoloading method calls
:that bothered me in an MI scenario.  Seems to me you respondedi
:similarly then.  I'm pretty sure it was the following inheritance
:scenario:
:
:                A
:                 \
:                  B   C         @B::ISA = ('A');
:                   \ /
:                    D           @D::ISA = ('B', 'C');
:
:Suppose that each of those classes were using autoloading to generate
:its attribute accessors.  If D->m() is called, and that method m()
:is really supposed to be handled iby C, there's no way for B's
:autoload to "super" it over to C.  Instead, B::SUPER just gets to
:ascend to A--which doesn't help.  You can never renege on an AUTOLOAD
:so that Perl's method lookup would treat that hit as a miss and
:then go on to inspect sibling branches of the tree.

I fail to see how AUTOLOAD is connected to this problem. Even if B did
not have an autoloaded m(), then A's m() would be used, since Perl
looks up the tree starting with B, in a depth-first order.

There's no way to "select" C::m() for polymorphic access of a D object,
but to reverse the order of declaration in @D::ISA. And that does not
scale well with a complex framework.

Raphael


Follow-Ups from:
Graham Barr <gbarr@pobox.com>
References to:
Tom Christiansen <tchrist@chthon.perl.com>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]