Last active
December 18, 2015 18:19
-
-
Save swannodette/5825442 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 [x true | |
y true | |
z true] | |
(match [x y z] | |
[_ false true] 1 | |
[false true _ ] 2 | |
[_ _ false] 3 | |
[_ _ true] 4 | |
:else 5)) | |
;; becomes >> | |
(try | |
(clojure.core/cond | |
(clojure.core/= y false) (try | |
(clojure.core/cond | |
(clojure.core/= z true) 1 | |
:else | |
(throw clojure.core.match/backtrack)) | |
(catch | |
Exception | |
e__1557__auto__ | |
(if | |
(clojure.core/identical? | |
e__1557__auto__ | |
clojure.core.match/backtrack) | |
(do | |
(throw | |
clojure.core.match/backtrack)) | |
(throw e__1557__auto__)))) | |
(clojure.core/= y true) (try | |
(clojure.core/cond | |
(clojure.core/= x false) 2 | |
:else | |
(throw clojure.core.match/backtrack)) | |
(catch | |
Exception | |
e__1557__auto__ | |
(if | |
(clojure.core/identical? | |
e__1557__auto__ | |
clojure.core.match/backtrack) | |
(do | |
(throw | |
clojure.core.match/backtrack)) | |
(throw e__1557__auto__)))) | |
:else (throw clojure.core.match/backtrack)) | |
(catch | |
Exception | |
e__1557__auto__ | |
(if (clojure.core/identical? | |
e__1557__auto__ | |
clojure.core.match/backtrack) | |
(do | |
(try | |
(clojure.core/cond | |
(clojure.core/= z false) 3 | |
(clojure.core/= z true) 4 | |
:else (throw clojure.core.match/backtrack)) | |
(catch | |
Exception | |
e__1557__auto__ | |
(if (clojure.core/identical? | |
e__1557__auto__ | |
clojure.core.match/backtrack) | |
(do 5) | |
(throw e__1557__auto__))))) | |
(throw e__1557__auto__)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment