Note that if you're only interested in using the resulting map as a function, (comp f map) works well (you can throw memoize in for good measure).
On Sun, Oct 11, 2009 at 2:40 AM, samppi <rbysam...@gmail.com> wrote: > > Is there a function in the standard libraries that's equivalent to > this: > > (defn transform-map [pred a-map] > (into {} (map (comp pred val) a-map))) > > (is (= {:a 4, :b 3} > (transform-map inc {:a 3, :b 2}))) > > It's not like I can't write this myself; I use this a lot, though, and > I'm wondering if it's somewhere in the core or contrib. (I searched, > but I couldn't find it, either.) > > > -- Professional: http://cgrand.net/ (fr) On Clojure: http://clj-me.blogspot.com/ (en) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---