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

Re: Missing sv_numeq() function?

Thread Previous | Thread Next
Paul "LeoNerd" Evans
September 14, 2021 20:32
Re: Missing sv_numeq() function?
Message ID:
On Sun, 12 Sep 2021 16:59:08 +0100
"Paul \"LeoNerd\" Evans" <> wrote:

> Maybe I can solve all of these issues in one go, by making a new
> sv_streq_flags() which does overload by default, and put that
> behaviour in my new sv_numeq_flags() as well, then these functions
> can all respond to the same SV_SKIP_OVERLOAD flag in the same way.
> Then sv_eq() and sv_eq_flags() become wrappers of sv_streq_flags()
> which do pass the SV_SKIP_OVERLOAD flag. I think it would be nice to
> do overload by default as that's generally "the nice thing to do",
> and a flag to turn it off for specific circumstances.

Further update: I've decided that it probably makes sense for it to do
overloading, unless told not to with the SV_SKIP_OVERLOAD flag. So now
it does:

  [sv_numeq e47b37a026] Have sv_numeq() respect == overloading unless the SV_SKIP_OVERLOAD flag is passed

After this PR is merged, I think I'll do the same for adding an
sv_streq() with the same API shape; thus fixing the odd name of sv_eq()
and its lack of overloading support at the same time.

Paul "LeoNerd" Evans      |  |

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