In Clojure, I want to both rename-keys and select-keys from a map. The simple way of doing is with:
(-> m
(rename-keys new-names)
(select-keys (vals new-names)))
But this will itetate over the entire map twice. Is there a way to do it with one iteration?
(**keys** new-names)
and then rename the (small) result – cfrick(comp m new-names-to-old-names-map)
– cgrand{:new-key-1 (my-map :old-key-1) :new-key-2 (my-map :old-key-2) :new-key-3 (my-map :old-key-3)}
– WarFox