I often need to map a function over the values of a map while
preserving keys--something like:
[code]
(defn mapmap [fn m]
(let [k (keys m)
v (map fn (vals m))]
(zipmap k v)))
(mapmap inc {:a 0, :b 1})
[/code]
Is there a more concise way to do this in Clojure? If not, is this
something that might be worth putting in the contrib?
-Jon
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---