Tricky semantics of ranges & potentially numerous Phobos bugs

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Oct 17 11:11:42 PDT 2012


On 10/17/12 12:57 PM, David Nadlinger wrote:
> On Wednesday, 17 October 2012 at 15:14:44 UTC, Andrei Alexandrescu wrote:
>> Such issues do happen, are relatively rare, and are virtually untested
>> because there's been no unittests with a deliberately "bad" input
>> range. Although of course we do need to add the appropriate fixes and
>> unittests, I'm not worried about it at all systemically.
>
> If an abstraction encourages use in a way which leads to hard-to-detect
> logic bugs that do not occur with the most common test cases, this is
> _exactly_ the thing we should be worried about!

When I designed input ranges vs. forward ranges there were long 
discussion on how to distinguish them. If you have a better design it 
would probably not influence the state of the affair, but it would be a 
good discussion to have. FWIW I can already think of a couple but all 
rely on UFCS.

Andrei




More information about the Digitalmars-d mailing list