On Sep 11 2007, Brandon Black wrote:
> On 9/11/07, hv crypt.org <hv crypt.org> wrote:
> > "Brandon Black" <blblack gmail.com> wrote:
> > :[...] The behavior of the current base
> > :and the proposed change is different even without
exceptions (although
> > :in ways you wouldn't think a sane module would
care about, but
> > :still...). When you do the following with the
current base.pm:
> > :
> > :perl -wle 'package AA; ISA=(); package BB; use
base qw/AA/; package
> > :CC; use base qw/BB AA/; package main; print
join(q{,}, CC::ISA)'
> > :
> > :It prints just "BB". CC::ISA
does not contain "AA" even though it
> > :was explicitly asked for. This is due to the
"next if
> > :$inheritor->isa($base)" line. With the
proposed push-all-at-once
Yes, I completely missed the significance of this line.
> > :logic, CC::ISA would instead be qw/BB AA/ as
asked for.
> >
> > I think that could be fixed just by replacing the
check with:
> > next if grep $_->isa($base), ($inheritor,
isa_classes);
> >
>
> Hmmm yeah that should have the same effect as the
original I think.
It would, although your point that some other MRO might get
tripped up
by this fudging of ISA is still valid. And of course there's
still the
open question of how useful this optimization is anyway.
--
Rick Delaney
rick bort.ca
|