On Sep 6, 11:40 am, Nicolas Oury <nicolas.o...@gmail.com> wrote:
> is there a function to map a function to all values in a map, keeping
> the same keys?

I like "reduce" because you can modify both the key and the value, and
even choose to omit or add certain keys:

    (reduce (fn [[k v] m] (assoc m k (...do stuff with v...)) {} the-
input-map)

The more common "into/map" style may be slightly easier to understand:

    (into {} (map (fn [[k v]] ...return a pair...) the-input-map)

Neither form is lazy, because Clojure maps aren't lazy.

-S

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