Re: sorted-set-by with custom comparator frauds equality

2013-07-25 Thread Meikel Brandmeyer (kotarak)
Hi, you are using comparator incorrectly. The function you pass there should return true, when x is to the left of y when called as (f x y). See the following example. user=> (defrecord Foo [a b]) user.Foo ; Wrong usage: your example (The new element is always smaller!) user=> (-> (sorted-set-b

sorted-set-by with custom comparator frauds equality

2013-07-25 Thread gixxi
Hi all, please consider the following record definition (defrecord RDistance [node dist visited]) as well as an instance and a tree set with a custom comparator ordering content first by :visited and after that by :dist (def d (RDistance. "foo" 1 0)) (def tree (sorted-set-by (comparator (jux