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

Re: Proposed new API function: sv_rvunweaken

Thread Previous | Thread Next
September 1, 2017 10:55
Re: Proposed new API function: sv_rvunweaken
Message ID:
Dagfinn Ilmari Mannsaker wrote:
>        if (!SvOK(sv)) /* let undefs pass */
>            return sv;
>        if (!SvROK(sv))
>            Perl_croak(aTHX_ "Can't unweaken a nonreference");

This combination of semantics is rather arbitrary.  I'd prefer
that the API function have a consistent treatment of things other
than weak references: either croak on all, or return all unchanged.
Whatever the semantics, especially if they remain inconsistent, they
must be documented.


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