[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Aggregation and AUTOLOAD fun





On Mon, 14 Aug 2000, Ilmari Karonen wrote:
> That's all the documentation there is so far.  I'll be adding some POD to
> the module when I get a round tuit, but in the meantime I'd appreciate if
> people would test it with the weirdest inheritance/aggregation heirarchies
> they can think of and tell me if it breaks.  (Of course, if some other
> autoloading class without the same restarting code is first in the lookup
> sequence, it'll break and there's nothing I can do about it.)

Ok, obviously as soon as I posted this I found two obvious failure modes.
First of all, aggregate classes can't be properly subclassed at all, since
the AUTOLOAD method won't find the @AGGREGATE package array.

The second problem is both harder and more general.  If the "restarted"
search finds a method, and that method in turn wants to call a previously
unused aggregated method, it will fail since *Aggregate::AUTOLOAD is still
localized.

I've though about this until I feel like my brain is going to implode and
jump through a wormhole into another dimension, but I can't think of any
way around this.  I've even tried doing the recursive method lookup myself
in the AUTOLOAD method, but this would fail if two AUTOLOADs in the same
inheritance tree are doing the same without knowing about each other.

What Perl needs is a way for AUTOLOAD to decline a request, saying "Sorry,
haven't heard of such a method, keep on looking."  And it needs it badly.

Grmbl.  Not fun at all..

-- 
Ilmari Karonen - http://www.sci.fi/~iltzu/
"The screwdriver *is* the portable method."  -- Abigail in c.l.p.m



==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe