Is there a function to swap the key and value of a given map. So given a map, I want the keys to become values, and values the keys.
(swap {:a 2 b 4}) => {2 :
There's a function reverse-map in clojure.contrib.datalog.util, it's implemented as:
(defn reverse-map "Reverse the keys/values of a map" [m] (into {} (map (fn [[k v]] [v k]) m)))