Shouldn't hasSwappableElements work on char arrays?

bearophile bearophileHUGS at lycos.com
Thu Feb 24 13:55:43 PST 2011


Steven Schveighoffer:

> wait, you thought char[] was an array?  You poor poor soul ;)
> 
> I predict we shall get 1-2 questions/claims of incredulity like this a  
> month until we get a real string type.

There's a need for both unicode strings, and simpler strings of 7 bit ASCII chars (both mutable and immutable. The immutable ones must not allow to change their length. Their hashing value may be computed lazily even for the immutable strings). A ubyte[] is not a good enough replacement for an ASCII string. Even a puny language like Python3 has recognized this.

Bye,
bearophile


More information about the Digitalmars-d mailing list