Skip to content

Instantly share code, notes, and snippets.

@cch1
Forked from edw/pick-and-rename.clj
Created July 30, 2012 17:07
Show Gist options
  • Save cch1/3208387 to your computer and use it in GitHub Desktop.
Save cch1/3208387 to your computer and use it in GitHub Desktop.
Let-Over-Lambda
(let [undefined-value (atom :undefined-value)]
(defn pick-and-rename [col pick-map]
(apply assoc
{}
(flatten
(filter (fn [[k v]]
(not (= v undefined-value)))
(map (fn [[k v]]
[v (get col k undefined-value)])
pick-map))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment