The Case Against Autodecode

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Mon May 30 21:16:57 PDT 2016


On 5/30/16 5:51 PM, Walter Bright wrote:
> On 5/30/2016 8:34 AM, Marc Schütz wrote:
>> In an ideal world, we'd also want to change the way `length` and
>> `opIndex` work,
>
> Why? strings are arrays of code units. All the trouble comes from
> erratically pretending otherwise.

That's not an argument. Objects are arrays of bytes, or tuples of their 
fields, etc. The whole point of encapsulation is superimposing a more 
structured view on top of the representation. Operating on open-heart 
representation is risky, and strings are no exception. -- Andrei


More information about the Digitalmars-d mailing list