Created
May 13, 2019 11:29
-
-
Save barkanido/316e66589006617a2c543f43e0fde610 to your computer and use it in GitHub Desktop.
beware of clojure.core.match
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
(match/match [a b] | |
[_ true] :first | |
[true false] :second | |
[_ false] :third) | |
(try | |
(cond | |
(= b true) :first | |
(= b false) (try | |
(cond | |
(= a true) :second | |
:else (throw match/backtrack)) | |
(catch Exception e__23778__auto__ | |
(if | |
(identical? e__23778__auto__ match/backtrack) | |
(do (throw match/backtrack)) | |
(throw e__23778__auto__)))) | |
:else (throw match/backtrack)) | |
(catch Exception e__23778__auto__ | |
(if | |
(identical? e__23778__auto__ match/backtrack) | |
(do | |
(try | |
(cond | |
(= b false) :third | |
:else (throw match/backtrack)) | |
(catch Exception e__23778__auto__ | |
(if | |
(identical? e__23778__auto__ match/backtrack) | |
(do | |
(throw | |
(java.lang.IllegalArgumentException. | |
(str "No matching clause: " a " " b)))) | |
(throw e__23778__auto__))))) | |
(throw e__23778__auto__)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment