On Sat, Apr 17, 2010 at 12:01 AM, Sean Devlin <francoisdev...@gmail.com> wrote: > I know you might not like it, but there is a convention in JavaLand > that a comparator value of 0 is identical in a sorted collection.
It's not a Java convention. It's intrinsic to the business of sorting. For sorting to give well-defined results, it must be based on an ordering that respects the trichotomy law, which says that, for all x and y, exactly one of the following three conditions must hold: x < y, x = y, x > y. If you define the < and > based on a custom comparator but use the default equality implementation for the = then you cannot expect this to hold. Packaging all three relations together lets the implementor of the comparator guarantee trichotomy. -Per -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en