On Thu, 06 Mar 2014 21:37:13 -0500, Walter Bright <newshou...@digitalmars.com> wrote:

Is there any hope of fixing this?

Yes, make d strings not char arrays, but a library-defined struct with an array as backing.

auto x = "..."; compiles to => auto x = string(cast(immutable(char)[])"...");

Then define string to be whatever kind of range you want in the library, with whatever functionality you want.

Then if you want by-char traversal, explicitly use immutable(char)[] as x's type. And in the string range's members, we can provide whatever access we want.

Note, this also fixes foreach, and many other problems we have. Most likely code that works today will continue to work, since it's much more of a bear to type immutable(char)[] instead of string :)

-Steve

Reply via email to