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

[perl #120386] av_len documentation

Thread Previous
bulk88 via RT
October 30, 2013 09:01
[perl #120386] av_len documentation
Message ID:
On Tue Oct 29 22:27:41 2013, 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

via perlbug:  queue: perl5 status: open

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