My experience making an on-disk merge sort using ranges

Jonathan M Davis jmdavisProg at gmx.com
Tue Feb 26 23:32:42 PST 2013


On Wednesday, February 27, 2013 08:05:28 Chris Cain wrote:
> Thank you too. I was about to write my own range-based solution
> to solve this problem and just happened across nWayUnion while I
> was looking for useful components. I was close to coding my own
> solution (using the heap from std.container, no less) and found
> out that my solution was already written. I've run across many
> such gems in the standard library and it never ceases to amaze me
> just how flexible, effective, and (usually) fast everything is.

In a way, all of that power and flexibility is exactly the problem. When 
dealing with generic code like Phobos does, it's fairly difficult to test it 
thoroughly enough to make sure that it works with all of the various inputs 
that it can be given - especially when you start combining all kinds of stuff. 
Both the code and the tests are continually improving, but for a lot of it, if 
you poke it hard enough, you'll be able to find corner cases that don't work 
quite right yet. But the more that gets tried, and the more problems that get 
found,  the more of them that will get fixed, and the less frequently you'll 
run into bugs when dealing with std.algorithm and its ilk.

- Jonathan M Davis


More information about the Digitalmars-d mailing list