develooper Front page | perl.perl6.language | Postings from August 2006

naming of the Str type

Thread Next
Darren Duncan
August 8, 2006 17:26
naming of the Str type
Message ID:
This may be a non-problem in practice, but ...

Regarding the Str data type, which Perl 6 defines as holding a 
compact sequence of characters, I'm thinking that this type's current 
name is ambiguous considering the traditional uses of the word.

Traditionally, a "string" isn't necessarily a sequence of characters, 
but could also be a sequence of octets or bits or other things.  A 
lot of programmers can see the word "string" and think of that term 
in its more broad sense.

I'm wondering if it would not be inappropriate to change the name Str 
to something more descriptive of its content within the historical or 
current wider context.

For example, would the name Text be any worse?  In my mind, that is 
less ambiguous and specifies a string of characters rather than a 
string of bytes.

Moreover, the general public better understands the meaning of the 
word Text than string, which could help in some small way to bringing 
new people to the language.  (And Perl 6 is meant to be more 
ideomatic like human languages, within reason, is it not?)

Of course, "Character String" or "Char Str" or "Char Data" would also 
be unambiguous, but that is two words, and all our built-in types are 
composed of 1 word.  Also, I discount "Char" as an option, because 
while it speaks characters, it is ambiguous as to whether it is 
exactly 1 character or a string of such.  So "Text" seemed to be the 
best compromise.

So, stepping aside from any "it ain't broke" arguments in the favor 
of Str, is there anything about the name Text that makes it a worse 
or better candidate in regards to specificity or ambiguity in your 

Or alternately, are there any other names which might work better 
than Str for specifying character data?

-- Darren Duncan

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