std.string and ranges

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Sun Feb 8 04:37:51 PST 2009


Andrei Alexandrescu wrote:
> dsimcha wrote:
>> Is std.string by any chance going to see any ripple effects from 
>> ranges?  I
>> want to write some patches to make it work with CTFE, which would be 
>> useful
>> for some compile time mixin generation, but I don't want to waste time 
>> working
>> on a module that Andrei is going to completely revamp anyway.
> 
> Yes, std.string must be revamped too. You may want to hold onto your 
> work for a little while more.

Then I suppose the next question should be:
will a char[] be a range of char, or a range of dchar? (Let's keep wchar 
out of it)

On the one hand, char is the logical option since that's what the array 
actually contains. Also, this better allows for mutability (since 
encoding dchars can lead to not having enough space to store 
replacements in the current position).

On the other hand, dchars would probably be more useful in many situations.

Maybe an adapter could be written, taking a char[] (or any range of 
chars/wchars) and acting as a range of dchars?
Perhaps also similar adapters to convert to chars and wchars?



More information about the Digitalmars-d mailing list