Created
September 7, 2016 23:05
-
-
Save amalloy/c616848d75ff378ecce460dc443937d6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(let [[a b c] (repeatedly gensym) | |
e1 [a b] | |
e2 [a c]] | |
(fn [x] | |
(let [y (conj x e1 e1 e2) | |
diff (- (count y) (count x))] | |
(condp = diff | |
1 :map | |
2 :set | |
(if (= (first y) e2) | |
:list | |
:vector))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
;;;My solution is similar but quite different too: