Skip to content

Instantly share code, notes, and snippets.

@mecdemort
Created April 4, 2011 17:36
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 mecdemort/fd02f373dd819b5e4536 to your computer and use it in GitHub Desktop.
Save mecdemort/fd02f373dd819b5e4536 to your computer and use it in GitHub Desktop.
(def tuple '((1 "foo") (2 "bar") (3 "foo")))
(def opts { 0 1, 1 "foo" })
(filter #(every? identity (for [key (keys opts) :let [line %]] (= (opts key) (nth line key)))) tuple)
(for [t tuple
:when (every? #(= (opts %) (nth t %)) (keys opts))]
t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment