Yes that compareTo doesn't define a total order on your class. I think you are missing a clause in cond:
(cond (= sr sr2) 0 (= (.lik sr) (.lik s2)) return something based on quasi-isomorphic (> (.lik sr) (.lik sr2)) -1 :default 1) I think you should implement quasi-isomorphic as a compare function (Comparator), then: equals: (and (= lik (.lik other)) (= 0 (compare-quasi-isomorphism tree (.tree other)))) compareTo: (let [l (- (.lik sr) (.lik sr2)) q (compare-quasi-isomorphism (.tree sr) (.tree sr2))] (cond (and (= l 0) (= q 0)) 0 (not= l 0) l (not= q 0) q :default 1)) -- 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