function | since v0.0-927 | clojure.set/rename-keys | Edit |
(rename-keys map kmap)
Returns the map with the keys in kmap renamed to the vals in kmap
(defn rename-keys
[map kmap]
(reduce
(fn [m [old new]]
(if (contains? map old)
(assoc m new (get map old))
m))
(apply dissoc map (keys kmap)) kmap))