I'm seeking perl wisdom against my "OO wisdom" ;-)
But maybe my OO wisdom needs to be updated, too.
I've written an XS speedup for Params::Util - and the author detects that my XS implementation of _INSTANCE differs to his perl implementation: The perl implementation simply calls $obj->isa($class) - and returns the result. The XS implementation checks first sv_derived_from and only in a negative result, it calls $obj->isa($class) (I think, I should even prove string equality of sv_reftype - but this is another story). My reason to implement it this way was:
B is a Aclass A { ... }; class B : public A { ... };
So what do you think? Should the XS implementation give the (overridable) isa method the precedence? Or is it just a limitation? Should the perl implementation better use UNIVERSAL::isa before trying the overridden method?
In reply to sv_derived_from vs. sub ISA by rehsack
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |