std.string will get the boot

Ali Çehreli acehreli at yahoo.com
Fri Jan 29 13:18:45 PST 2010


Jacob Carlborg wrote:

 > I would keep std.string for string specific functions and perhaps
 > publicly import std.algorithm. For exmaple functions like: tolower, icmp
 > and toStringz.

I've been thinking about characters lately and have realized that 
tolower, toupper, icmp, and friends should not be in a string library. 
Those functions need an "alphabet" to be useful; not language, nor locale...

In fact, the character itself must have alphabet information. Otherwise 
a string like "ali & jim" cannot be converted to upper-case correctly(*) 
as "ALİ & JIM". And the word "correctly" there depends on each 
character's alphabet.

Similarly, two characters that look the same cannot be compared for 
ordering. Comparing the 'x' of one alphabet to the 'x' of another 
alphabet is a meaningless operation.

Ali



More information about the Digitalmars-d mailing list