Conrad,
(into {}
(filter (fn [[key val]]
(even? val))
{:dog 5 :cat 4 :mouse 7 :cow 6}))
=>
{:cat 4, :cow 6}
There's probably also a higher-order function that does what you want
in contrib, something like
(defn filter-map-v [f m]
(into {}
(filter (fn [[k v]] (f v)) m)))
so that you can write
(filter-map-v even?
{:dog 5 :cat 4 :mouse 7 :cow 6})
I haven't looked for it, though.
-R
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---