« first day  last day (14 days later) » 

1:22 AM
@supercat Well, that's what comparators do. But i'm not sure where you get that it's a requirement. The only necessary conditions (aside from returning ints) are that comparing some object with itself returns 0, and that null is less than any object.
No other requirements are mentioned.
So i fully expect to be able to pass a "comparator" that uses a RNG if i want to shuffle the list, for example. And if i can't, then the documentation for IComparer and Comparison<T> needs fixing.
 
 
1 hour later…
2:54 AM
It would be possible to write a sort algorithm which, given a consistent partial ranking (one in which a>b and b>c would imply that a>c, but where a>c would not imply that either a>b or a>c), would be able to yield a result which was consistent with the partial ranking, but most sort algorithms do not behave that way.
 
 
1 hour later…
4:16 AM
I don't care how it works. Encapsulation. :P I care what it asks for. And all it asks for is an object or delegate that tells it whether one item comes before another. If it doesn't make any stricter demands than that, then anything that can fit that definition is permissible. Even if it says that everything is equal. Even if it's not consistent. Even if it's totally random. As long as it behaves like IComparer or Comparison say it has to, it should work.
 
 
10 hours later…
2:32 PM
And though i don't want to get into a static vs dynamic typing argument, note that what you really want is basically duck typing and/or "concepts". In a language where polymorphism is shackled to inheritance, the language itself is going to fight against you. But you chose the shackles when you chose the language. Don't try to wiggle out of them now.
 

« first day  last day (14 days later) »