string is rarely useful as a function argument

Timon Gehr timon.gehr at gmx.ch
Sat Dec 31 11:24:52 PST 2011


On 12/31/2011 08:06 PM, Andrei Alexandrescu wrote:
> On 12/31/11 10:47 AM, Sean Kelly wrote:
>> I don't know that Unicode expertise is really required here anyway.
>> All one has to know is that UTF8 is a multibyte encoding and
>> built-in string attributes talk in bytes. Knowing when one wants
>> bytes vs characters isn't rocket science. That said, I'm on the fence
>> about this change. It breaks consistency for a benefit I'm still
>> weighing. With this change, the char type will still be a single
>> byte, correct? What happens to foreach on strings?
>
> Clearly this is a what-if debate. The best level of agreement we could
> ever reach is "well, it would've been nice... sigh".
>
> It's possible that we'll define a Rope type in std.container - a
> heavy-duty string type with small string optimization, interning, the
> works. That type may use insights we are deriving from this exchange.
>
>
> Andrei

That would be great.


More information about the Digitalmars-d mailing list