The Case Against Autodecode

Seb via Digitalmars-d digitalmars-d at puremagic.com
Tue May 31 07:33:46 PDT 2016


On Tuesday, 31 May 2016 at 13:33:14 UTC, Marc Schütz wrote:
> On Monday, 30 May 2016 at 21:51:36 UTC, Walter Bright wrote:
>> [...]
>
> So, strings are _implemented_ as arrays of code units. But 
> indiscriminately treating them as such in all situations leads 
> to wrong results (just like arrays of code points would).
>
> [...]

If we follow Adam's proposal to deprecate front, back, popFront 
and popBack, we don't even need to touch the compiler and it's 
trivial to do so.
The proof of concept change needs eight lines.

https://github.com/dlang/phobos/pull/4384

Explicitly stating the type of iteration in the 132 places with 
auto-decoding in Phobos doesn't sound that terrible.


More information about the Digitalmars-d mailing list