On 2011-01-16 02:11:14 -0500, foobar <[email protected]> said:
I Understand your concern regarding a simpler implementation. You want
to minimize the disruption caused by the proposed change.
I'd argue that creating a specialized string type as Steve suggests
makes integration *easier*. Your suggestion requires that foreach will
be changed to default to grapheme. I agree that this can be done
because it will not break silently but with Steve's string type this is
unnecessary since the type itself would provide a grapheme range
interface and the compiler doesn't need to know about this type at all.
string becomes a regular library type.
Of course, the type should support:
string foo = "bar";
by making an implicit conversion from current arrays (to minimize
compiler changes)
It should also work for:
auto foo = "bar";
The only disruption as far as I can tell would be using 'a' type
literals instead of "a" but that will come up in compilation after
string defaults to the new type.
You say "after string defaults to the new type", but I don't think this
change to the language will pass. It'll break TDPL for one thing, so
it's surely out for D2. And I somewhat doubt it's low-level enough for
Walter's taste.
I don't care much if the default type is an array or not, I just want
the default type to work properly as a Unicode string. The very small
participation to this thread from the key decision makers (Andrei and
Walter) worries me however. I'm not even sure we'll achieve that goal.
--
Michel Fortin
[email protected]
http://michelf.com/