Tassilo von Parseval wrote:


Where did it work? Further above you said that the comparison 'a == &PL_sv_yes' was never true.


Yeah ..... confusing :-)

I have a module that has:

use overload '-' => \&mysub;

where mysub() is an XS subroutine. (Actually, there's a little more to the module than just that :-)

Anyway, mysub() looks like:

SV * mysub(SV * a, SV * b, SV * three) {
if(three == &PL_sv_yes) // return b-a
else // return a-b
}

mysub() always gets it right because overload.pm always presents the appropriate arguments to mysub().

Problem was that *I* couldn't write any code (perl or XS) such that 'sv == &PL_sv_yes' was true. No matter how *I* was writing *my* code 'sv == &PL_sv_yes' was always returning false.

Cheers,
Rob




Reply via email to