you can use reduce-kv...This is exactly its purpose - to be able to reduce maps without the need of destructuring

example:

(reduce-kv some-fn-with-3-args {} old-map)

Jim

On 09/01/13 18:09, Jonathon McKitrick wrote:
I have a map derived from JSON data where the keys are strings. I want to build a new map from this one, where the new keys are based on integers extracted from the strings of the old keys by a regex. Not all entries will be transformed into the new map.

In Common Lisp, I would LOOP and PUSH entries onto the map, but I need to learn the Clojure way of immutability.

What's the best way to create this map?

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