Hi all,

Consider the following record definition, a respective record instance as 
well as a sorted tree set with a custom comparator sorting first the 
:visited property and the by the :dist property of the record.

(defrecord RDistance
  [node dist visited])

(def d (RDistance. "foo" 1 0))

(def tree (sorted-set-by (comparator (juxt :visited :dist)) d))


I expect conj d again to the set would change the set, but doing so in the 
repl results in the set containing two equal elements

user=> (conj tree d)
#{#user.RDistance{:node "foo", :dist 1, :visited 0} #user.RDistance{:node 
"foo", :dist 1, :visited 0}}

What is the problem?


Thanks for your help
Best regards

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to