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

Re: Is this small perlapi amendment correct?

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
July 19, 2013 22:21
Subject:
Re: Is this small perlapi amendment correct?
Message ID:
20130719222131.GG2177@iabyn.com
On Fri, Jul 19, 2013 at 07:51:49AM +0200, Steffen Mueller wrote:
> Is this correct

yes

> and useful to apply?

Possibly. Perl_av_pop already has some wording to that effect:

    Removes one SV from the end of the array, reducing its size by one and
    returning the SV (transferring control of one reference count) to the
    caller.  Returns C<&PL_sv_undef> if the array is empty.

It would be best if they used similar phasing, although I'm undecided
which one is clearer.

> diff --git a/av.c b/av.c
> index fb01f48..4a6023b 100644
> --- a/av.c
> +++ b/av.c
> @@ -701,6 +701,9 @@ Shifts an SV off the beginning of the
>  array.  Returns C<&PL_sv_undef> if the
>  array is empty.
> 
> +The caller will own the refcount of the returned SV that was
> +previously owned by the AV.
> +
>  Perl equivalent: C<shift(@myarray);>
> 
>  =cut

-- 
"There's something wrong with our bloody ships today, Chatfield."
    -- Admiral Beatty at the Battle of Jutland, 31st May 1916.

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