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

Re: Missing sv_numeq() function?

Thread Previous | Thread Next
From:
Paul "LeoNerd" Evans
Date:
September 14, 2021 20:32
Subject:
Re: Missing sv_numeq() function?
Message ID:
20210914213222.08cc70a2@shy.leonerd.org.uk
On Sun, 12 Sep 2021 16:59:08 +0100
"Paul \"LeoNerd\" Evans" <leonerd@leonerd.org.uk> 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

leonerd@leonerd.org.uk      |  https://metacpan.org/author/PEVANS
http://www.leonerd.org.uk/  |  https://www.tindie.com/stores/leonerd/

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About