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

Re: Proposed new API function: sv_rvunweaken

Thread Previous | Thread Next
From:
Zefram
Date:
September 1, 2017 10:55
Subject:
Re: Proposed new API function: sv_rvunweaken
Message ID:
20170901105528.GI23538@fysh.org
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.

-zefram

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