So if I understand you correctly, it's recommented to do:Should the XS implementation give the (overridable) isa method the precedence?Only if you want Perl's OO to keep working. In all other cases -- every one -- Perl calls overridden methods which optionally call super methods.
(Modern versions of UNIVERSAL explicitly recommend against calling UNIVERSAL::isa directly.)
against:package A; sub foo {}; package B; sub bar {}; package C; use vars qw(@ISA); @ISA = qw(B); sub foo {}; sub isa { return $_[1] eq 'A' or $_[0]->SUPER::isa(@_); }
Or at least it's an allowed and wanted to work way? Further: It's allowed and wanted to work that:package A; sub foo {}; package B; sub bar {}; package C; use vars qw(@ISA); @ISA = qw(A B);
To prevent, C is no B?package C; use vars qw(@ISA); @ISA = qw(B); sub foo {}; sub isa { return $_[1] eq 'A'; }
In reply to Re^2: sv_derived_from vs. sub ISA
by rehsack
in thread sv_derived_from vs. sub ISA
by rehsack
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |