std.string will get the boot

Jacob Carlborg doob at me.com
Fri Jan 29 15:21:43 PST 2010


On 1/29/10 22:18, Ali Çehreli wrote:
> 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

I'm not sure I really understand this, probably because I don't know 
much about how Unciode works. I'm thinking out loud:

If "i", as you have in "ali", have the corresponding "İ" as upper case 
wouldn't that be another character than the English "i"? If so, I'm not 
sure I see the problem. If not, I see the problem.



More information about the Digitalmars-d mailing list