On Thu, Jun 24, 2004 at 04:19:25PM -0400, Jonadab the Unsightly One wrote:
: Larry Wall wrote:
: 
: >What do you mean by "length"?  
: 
: For a string, it obviously either means number of bytes or number
: of characters.  Pick one, document it, and let people who want the
: other semantic use a pragma.

What do you mean by "character"?  Do you mean codepoint or grapheme?
And if grapheme, language dependent or language independent?  (Leaving
aside the fact that ten years ago "character" generally meant "byte".)

: I don't think it matters which one you pick as default, as long
: as it's clearly documented.

Documentation has not kept people from saying length(@array) over
and over in Perl 5.  In such cases it's better not to have a default,
as long as it's not too onerous to be specific.  In Perl 6 you never
ask for the length().  You ask for things like bytes(), codepoints(),
graphemes(), or elems().  This is an area where clarity must be
enforced.  Muddy concepts like "characters" and "length" will only
produce muddy programs.

Larry

Reply via email to