When given a foreign class inheritance, why doesn't this code segment push that class name onto the @ISA array?
CPAN::Forum
Object-InsideOut - Getting a foreign class pushed onto the @ISA array
| Posted on Mon Jan 30 20:18:56 2006 by earl |
| Getting a foreign class pushed onto the @ISA array |
|
When given a foreign class inheritance, why doesn't this code segment push that class name onto the @ISA array?
foreach my $parent (@packages) {
if (exists($TREE_TOP_DOWN{$parent})) {
# Inherit from Object::InsideOut class
foreach my $ancestor (@{$TREE_TOP_DOWN{$parent}}) {
if (! exists($seen{$ancestor})) {
push(@tree, $ancestor);
$seen{$ancestor} = undef;
}
}
push(@{$class.'::ISA'}, $parent);
$need_oio = 0;
} else {
# Inherit from foreign class
# Get inheritance 'classes' hash
if (! exists($HERITAGE{$class})) {
create_heritage($class);
}
my $classes = $HERITAGE{$class}[1];
# Add parent to inherited classes
$classes->{$parent} = undef;
}
}
I have an inside out class IOC that ISA PVC class. PVC in a pure virtual class and therefore a foreign class. Within the IOC package, I have the ...
use Object::InsideOut qw/PVC/;
When I use IOC and print out it's @ISA array, PVC is not there. I looked at the Object::InsideOut code that mutates @ISA. I thought it should push inherited foreign class onto @ISA. What should I do to get PVC onto the @ISA array? Earl |
| Direct Responses: 1723 | Write a response |
(2)
]