Last active
August 29, 2015 14:16
-
-
Save thattommyhall/d843d87e7165043200cf to your computer and use it in GitHub Desktop.
this?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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