Skip to content

Instantly share code, notes, and snippets.

@Licenser
Created June 4, 2010 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Licenser/425518 to your computer and use it in GitHub Desktop.
Save Licenser/425518 to your computer and use it in GitHub Desktop.
(defn choose-hashmap [[ & left-ms] [& right-ms] k]
(map
(fn [left]
(if (contains? left k)
(let [left-v (get left k)]
(or (first
(drop-while
(fn [right]
(not (and
(contains? right k)
(= left-v (get right k))))) right-ms)) left)))) left-ms))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment