On Wednesday, 24 June 2015 at 11:12:27 UTC, John Chapman wrote:
On Wednesday, 24 June 2015 at 01:04:01 UTC, Adam D. Ruppe wrote:
The code breakage is minimal

Won't this break isSomeString? Phobos uses this everywhere.

It won't break isSomeString. isSomeString will continue to work the same. What it will mean is that the result of toLower won't pass isSomeString anymore, and if you pass it to a range-based function which has an overload for strings, it won't match it and will be treated the same as a range like FilterResult and not get the string optimizations. If you want it to actually be a string, then you'll need to use to!string on it (even std.array.array wouldn't work, since that would convert it to dchar[], not string).

So, that could be a reason why this isn't a great idea, but it once again highlights why having autodecoding is a bad idea, and it shows that as we increase how much we're doing with functions which return lazy ranges, the cost of having autodecoding will only increase, because we'll being dealing with strings directly less and less.

- Jonathan M Davis

Reply via email to