Sorry, didn't read your post properly. Maybe it's because the ints are of different types.
(contains? [(int 1)] (long 1)) false On Aug 2, 10:13 am, Oskar Kvist <oskar.kv...@gmail.com> wrote: > "Returns true if _key_ is present in the given collection, otherwise > returns false." > > For sets like #{200, 210} the values also count as keys. > > On Aug 2, 10:10 am, Petr Gladkikh <petrg...@gmail.com> wrote: > > > > > > > > > I spent hour already and can not understand what is wrong here. > > > I want to filter collection based on a nested field of collection > > element having some value: > > > (println pinned-ids) > > ; #{200, 210} > > > (println (contains? pinned-ids 200)) > > ; true > > > (println (map #(.. % :field :id) new-states)) > > ; (10 20 21 100 200 500 400 210) ; This collection contains both 200 and 210 > > > However no test is true > > (println (map #(contains? pinned-ids (.. % :field :id)) new-states)) > > ; (false false false false false false false false) > > > Why "contains?" return false for all elements despite that set > > pinned-ids contains some of elements? > > > -- > > Petr Gladkikh -- 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