In the code I'd make I'd always call these nchars and nelems and it would be intuitively clear (to me too one year after I wrote the code), but Perl 6 seems to like to mess with the accustomed minds. Renaming "for ( ; ; )" which was structurally identical to the C one to the "loop" is easy. Somebody also mentioned renamed ARGV to *ARGS. Examples aplenty.
It seems this and a lot of other details were intentionally made to clash with our habits, as I write in my other comment.
Re:Differences Between Perl 5 and Perl 6
by kbenson on Wednesday October 07, 2015 @02:02PM
(#10347728)
I don't necessarily disagree with your reasoning, but I vaguely recall there was quite a bit of debate about the naming of these methods when they changed, and I don't recall the arguments. I have a feeling it's too late to change them now, so it may just have to live on as a quirk of the language.
Re:Differences Between Perl 5 and Perl 6
by dragonwriter on Wednesday October 07, 2015 @02:39PM
(#10348009)
> I have a feeling it's too late to change them now, so it may just have to live on as a quirk of the language.
I can see that, and I don't think its all that bad, just suboptimal, and confusing based on more than just expectations shaped by other languages.
No, the convention that (thing that can be viewed as a collection of subelements in several different ways).(plural name for one kind of subelement) is a property/method providing a collection of the subelements of the named type is not only common in other languages, it is also quite common in Perl 6 -- and even followed (aside from chars) in the Str class specifically; examples include (from Str): univals, lines, words, ords
chars is the odd man out here: charcount or something similar would have been a lot cleaner. (Yes, its consistent with elems, but that seems to be poorly chosen for the same reason; its a plural name, but it provides a single numeric value.)