The Case Against Autodecode
Andrei Alexandrescu via Digitalmars-d
digitalmars-d at puremagic.com
Sat May 28 05:04:20 PDT 2016
On 5/28/16 6:59 AM, Marc Schütz wrote:
> The fundamental problem is choosing one of those possibilities over the
> others without knowing what the user actually wants, which is what both
> BEFORE and AFTER do.
OK, that's a fair argument, thanks. So it seems there should be no
"default" way to iterate a string, and furthermore iterating for each
constituent of a string should be fairly rare. Strings and substrings
yes, but not individual points/units/graphemes unless expressly asked.
(Indeed some languages treat strings as first-class entities and
individual characters are mere short substrings.)
So it harkens back to the original mistake: strings should NOT be arrays
with the respective primitives.
Andrei
More information about the Digitalmars-d
mailing list