develooper Front page | perl.perl5.porters | Postings from August 2021

Missing sv_numeq() function?

Thread Next
Paul "LeoNerd" Evans
August 20, 2021 10:55
Missing sv_numeq() function?
Message ID:
The behaviour in perl's `eq` operator is exposed to XS authors via

   BOOL sv_eq(SV *left, SV *right);

Nice and simple.

As far as I can tell there isn't an equivalent numerical one, for `==`.
I've had to write myself a 47 line wrapper function by copying out the
logic from Perl's (non-API-exposed) Perl_do_ncmp() function.

I propose adding an API function

   BOOL sv_numeq(SV *left, SV *right);

to cover this.

Paul "LeoNerd" Evans      |  |

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About