2010/9/21 Meikel Brandmeyer <m...@kotka.de> > Hi, > > On 21 Sep., 09:39, Laurent PETIT <laurent.pe...@gmail.com> wrote: > > > So (= m1 m2) may not imply (= (zipmap (keys m1) (vals m1)) (zipmap (keys > m2) > > (vals m2))) for any (m1, m2), hmmm, good to remember somewhere in my head > > ... :) > > I don't think that this is the case. What is meant, is (= (keys m1) > (keys m2)) is not necessarily true although maybe (= m1 m2). Eg.: > > user=> (def m (array-map :a 1 :b 2 :c 3 :d 4 :e 5 :f 6 :g 7 :h 8 :i > 9)) > #'user/m > user=> (def n (assoc m :j 10)) > #'user/n > user=> (= m (dissoc n :j)) > true > user=> (= (keys m) (keys (dissoc n :j))) > false > > However, your zipmap's above will always work, because the keys and > vals refer to the same map instance. >
Oh, yes, I should re-read my post today before hitting Enter. -- 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