Higher level built-in strings

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Jul 19 21:48:34 PDT 2010


On 07/19/2010 11:31 PM, Walter Bright wrote:
> Steven Schveighoffer wrote:
>> On Mon, 19 Jul 2010 16:04:21 -0400, Walter Bright
>> <newshound2 at digitalmars.com> wrote:
>>> Strings in D are deliberately meant to be arrays, not special things.
>>> Other languages make them special because they have insufficiently
>>> powerful arrays.
>>
>> Andrei is changing that. Already, isRandomAccessRange!(string) ==
>> false. I kind of don't like this direction, even though its clever.
>
> That decision may be a mistake.

I think otherwise. In fact I confess I am extremely excited. The current 
state of affairs described built-in strings very accurately: they are 
formally bidirectional ranges, yet they offer random access for code 
units that you can freely use if you so wish. It's modeling reality very 
accurately.

As far as I know, all algorithms in std.algorithm that work well without 
decoding are special-cased for strings to work fast and yield correct 
results.


Andrei


More information about the Digitalmars-d mailing list