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

[perl #126469] sv_reftype second argument is not described

Thread Previous
From:
Ben Bullock
Date:
October 28, 2015 06:16
Subject:
[perl #126469] sv_reftype second argument is not described
Message ID:
rt-4.0.18-26711-1446007039-1813.126469-75-0@perl.org
# New Ticket Created by  Ben Bullock 
# Please include the string:  [perl #126469]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=126469 >


There is no documentation of the second argument of sv_reftype.

Looking at the code in sv.c, it looks like

    if (ob && SvOBJECT(sv)) {
	return SvPV_nolen_const(sv_ref(NULL, sv, ob));
    }
    else {
       // only returns Perl-internal types like "SCALAR", not object types.
    }

Thus it seems "ob" should be true if we want to return object information, and false if we don't. I suggest documenting the second argument. Also, in case this is an omission, I'd like to point out that the SvOBJECT, SvOBJECT_on, and SvOBJECT_off macros are not documented anywhere in perlapi.

I am using Perl 5.18.2, but I checked the documentation of perlapi in 22.0 using the following web page:

http://perldoc.perl.org/perlapi.html

The documentation of sv_reftype, SvOBJECT, and SvOBJECT_on/off don't seem to have altered.

Thanks.


Thread Previous


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