News for hackers. Stuff that matters.
Re:The Evil Within the Comparison Functions by im3w1l on Sunday February 18, 2018 @08:32PM (#16410128)
Instead of having a function that says whether one object is bigger than another, you could define an ordering by having a function that maps objects to say natural numbers or real numbers or some other object with a known good comparison, and then compare the mapped objects.

So instead of implementing f in f(a, b), you'd implement f in f(a) < f(b)

Re:The Evil Within the Comparison Functions by abecedarius on Sunday February 18, 2018 @11:40PM (#16410788)
Also you could resolve hashing in the same way: i.e. making sure that hashing is consistent with equality. Two objects of the same type are equal if f(a) == f(b), and have hashcode hash(type, f(a)).