New string implementation: dstring 1.0
Chris Miller
chris at dprogramming.com
Tue Oct 24 02:56:41 PDT 2006
On Tue, 24 Oct 2006 05:12:21 -0400, Aarti_pl <aarti at interia.pl> wrote:
> 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[].
Thanks guys.
>
> 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).
But then it won't be ultra fast at finding dchar codepoints.
More information about the Digitalmars-d-announce
mailing list