More complexity creep in Phobos

FeepingCreature feepingcreature at gmail.com
Fri May 3 11:38:58 UTC 2019


On Monday, 1 April 2019 at 18:13:55 UTC, Olivier FAURE wrote:
> Why?
>
> Strings have the advantage of being extremely simple constructs 
> that represent exactly the right abstraction: they're a slice 
> of chars, period. They can be scoped, sliced and concatenated 
> just like any other range.
>

Well, you see, strings have the disadvantage of being constructs 
that represent exactly the wrong abstraction: they're a slice of 
chars, period.

To see the problem with this, consider:

writefln(
   "äöü are %s letters; the second one is %s",
   "äöü".length,
   cast(ubyte[]) "äöü"[1..2]);


More information about the Digitalmars-d mailing list