develooper Front page | perl.perl5.porters | Postings from April 2015

[perl #122281] [PATCH] clean up sv_isobject usage

bulk88 via RT
April 28, 2015 16:50
[perl #122281] [PATCH] clean up sv_isobject usage
Message ID:
On Sun Jul 20 17:51:02 2014, tonyc wrote:
> One pattern I see a lot in this patch is replacing C<<
> sv_isobject(foo) >> with C<< SvROK(e) && SvOBJECT(SvRV(e)) >> to skip
> the magic in sv_isobject().
> Wouldn't it be better to define a sv_isobject_nomg() macro?
> Tony

I dont think so. "sv_isobject_nomg" assumes there is a function call inside the macro, there isn't any in "SvROK(e) && SvOBJECT(SvRV(e))". Thev "SvROK(e) && SvOBJECT(SvRV(e))" expression is short enough that new API isn't really needed and will just make code more difficult understand  (from a quick look, "SvROK(e) && SvOBJECT(SvRV(e))" is obviously function call free, and "lightweight", sv_isobject_nomg() is "heavyweight" and obviously has a function call inside).

bulk88 ~ bulk88 at

via perlbug:  queue: perl5 status: open Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About