On Dec 17, 9:37 am, "C. Florian Ebeling" <florian.ebel...@gmail.com>
wrote:
> (defn mapmap
>   "Map values of map m using function f."
>   [f m]
>   (reduce (fn [m [k v]]
>             (assoc m k (f v))) {} m))
>
> But there is probably a more straightforward way. What do you use?


I do that exactly, but I never felt the need to define a new function
for it.  The advantage of "reduce" is that you can change the keys
too, and pick which keys end up in the final map.

-SS

-- 
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

Reply via email to