Skip to content

Instantly share code, notes, and snippets.

@thattommyhall
Last active August 29, 2015 14:16
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 thattommyhall/d843d87e7165043200cf to your computer and use it in GitHub Desktop.
Save thattommyhall/d843d87e7165043200cf to your computer and use it in GitHub Desktop.
this?
user> (def a [[1 2] [3 4] [5 6]])
#'user/a
user> (def b [[1 7] [2 8] [5 6]])
#'user/b
user> (map (fn [[a b] [c d]]
(if (= a c)
[b d]))
a
b)
([2 7] nil [6 6])
user> (filter (comp not nil?) (map (fn [[a b] [c d]]
(if (= a c)
[b d]))
a
b))
([2 7] [6 6])
user> (for [[x y] a
[u v] b
:when (= x u)]
[y v])
([2 7] [6 6])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment