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

[perl #120386] av_len documentation

Thread Previous
From:
bulk88 via RT
Date:
October 30, 2013 09:01
Subject:
[perl #120386] av_len documentation
Message ID:
rt-4.0.18-24531-1383123684-1953.120386-15-0@perl.org
On Tue Oct 29 22:27:41 2013, public@khwilliamson.com wrote:
> 
> I wrote the original text.  I realize that I do not have the talent to
> explain things easily, so I often look at what I've written and think
> of
> a better way to say it, or appreciate other people cleaning it up.
> But
> this time, I don't see anything wrong with the original.  sv_len of a
> length 1 string will return 1.  av_len of a length 1 array will return
> 0.  I think it is worth pointing out that their behaviors do not
> correspond.
> 
> In your first proposal, the word 'is' is missing, so it is not correct
> grammatically.
> 
> I like your second proposal, but again, I think it useful to contrast
> this behavior with sv_len.

Since av_len is av_top_index, they should share the same docs. I like the "The Perl equivalent for this is C<$#myarray>." in av_top_index and I'd like to see that in av_len. $# (or directly what the C function means in Perl) is the fastest way to realize what the C function does. The opposite of that is C<scalar(@myarray)>, which is what av_len does NOT do.

-- 
bulk88 ~ bulk88 at hotmail.com

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

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