New names - 2.068 roundup

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 24 06:43:03 PDT 2015


On 24/06/15 13:28, Jonathan M Davis wrote:

> 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.

Can't we update isSomeString to detect this use case?

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list