develooper Front page | perl.perl5.porters | Postings from December 2013

[perl #120826] call_sv's docs are misleading

Thread Previous | Thread Next
From:
bulk88 via RT
Date:
December 22, 2013 05:53
Subject:
[perl #120826] call_sv's docs are misleading
Message ID:
rt-4.0.18-16260-1387691622-1792.120826-15-0@perl.org
On Thu Dec 19 06:26:12 2013, ikegami@adaelis.com wrote:
> A comment in the source says "May be called with any of a CV, a GV, or an
> SV containing the name."
.......
> 
> But it also accepts a code reference. Specifically, when neither G_METHOD
> nor G_METHOD_NAMED was provided as a flag, it takes whatever pp_entersub
> takes.
> 

Not testing this.

>    - AV*, HV* and undef are errors.

HV and undef are tested. AV should be pointless to test.

>    - sv == &PL_sv_yes is a no-op. It is documented as "unfound import,
>    ignore".

Tested.

>    - GV*, CV*, code reference are accepted as the source of a CV*.

Tested.

>    - Anything else is presumed to be a string.

Tested.

> 
> Note: "GV*" is defined as: SvTYPE(sv) == SVt_PVGV or SvTYPE(sv) == SVt_PVLV
> && isGV_with_GP(sv)

IDK how to get a LV/isGV_with_GP.

APITest patch attached. Note, some of things being tested are not (and I don't think they should) be public API or documented. If some of the tests are broken in the future, the tests should be fixed or removed, not the future code.

-- 
bulk88 ~ bulk88 at hotmail.com

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=120826

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