Instantly share code, notes, and snippets.

View gist:4f587a6d1134bf43386047231caa0378
(defn replace-with
[repl-map ;{pattern1 fn1 pattern2 fn2 ...}
form]
(clojure.walk/postwalk
(fn [node]
(if-let [node-fn (get repl-map node)]
(node-fn node)
node))
form))