Skip to content

Instantly share code, notes, and snippets.

@edw
Created July 30, 2012 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save edw/3208379 to your computer and use it in GitHub Desktop.
Save edw/3208379 to your computer and use it in GitHub Desktop.
Nested DEF
(defn pick-and-rename [col pick-map]
(def undefined-value (atom :undefined-value))
(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