New string implementation: dstring 1.0

Aarti_pl aarti at interia.pl
Tue Oct 24 02:12:21 PDT 2006


Fredrik Olsson napisał(a):
> Chris Miller skrev:
>> Check out the FAQ at http://www.dprogramming.com/dstring.php and give 
>> it a spin.
>> Documentation is online at 
>> http://www.dprogramming.com/docs/dstring/dstring.html
>>
>> Let me know what you think!
> 
> I love it! This is very much needed and should go into Phobos yesterday!
> 
> Solves the problem of:
> char[] foo = "hög";
> assert(foo.length == 3); // Sorry UTF-8, this is == 4
> assert(foo[1] == 'ö');   // Not a chance!
> 
> You implementation of string could be a perfect wrapper that makes the 
> fact that UTF-8 is of variable char size, invisible to the programmer.
> 
> 
> // Fredrik Olsson


I didn't write it before when DString was introduced, but I got also 
very positive feelings about it.

As a programmer in common cases I should not be bothered about 
implementation details of string. It should not matter if I work with 
char[], wchar[] or dchar[].

I agree that it should be putted in Phobos immediately! (Maybe just some 
optimalizations with string size could be added, so adding one dchar to 
char[] string will not cause conversion from char[] to dchar[], but 
rather dchar to char).

Regards
Marcin Kuszczak
Aarti_pl



More information about the Digitalmars-d-announce mailing list