-
-
Save etosch/626088b01817ac638fae to your computer and use it in GitHub Desktop.
first macro expand
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
(let [q '(a) y '(b) z '(c)] | |
(macroexpand-1 | |
'(match [q y z] | |
[([_] :seq) _ _] 'a | |
[_ _ _] 'b))) | |
;; expands to | |
(try (clojure.core/cond (clojure.core/or (clojure.core/seq? q) (clojure.core/sequential? q)) | |
(try (clojure.core/let [q_tail__3463 (clojure.core/rest q)] | |
(clojure.core/cond (clojure.core/empty? q_tail__3463) | |
(clojure.core/let [] (quote a)) | |
:else (throw clojure.core.match/backtrack))) | |
(catch java.lang.Exception e__2590__auto__ | |
(if (clojure.core/identical? e__2590__auto__ clojure.core.match/backtrack) | |
(do (throw clojure.core.match/backtrack)) | |
(throw e__2590__auto__)))) | |
:else (throw clojure.core.match/backtrack)) | |
(catch java.lang.Exception e__2590__auto__ | |
(if (clojure.core/identical? e__2590__auto__ clojure.core.match/backtrack) | |
(do (clojure.core/let [] (quote b))) | |
(throw e__2590__auto__)))) |
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
(let [q '(a) y '(b) z '(c)] | |
(macroexpand-1 | |
'(match [q (seq y) z] | |
[([_] :seq) _ _] 'a | |
[_ _ _] 'b))) | |
;; expands to | |
(clojure.core/let [q q ocr-3470 (seq y) z z] | |
(try (clojure.core/cond (clojure.core/or (clojure.core/seq? q) (clojure.core/sequential? q)) (clojure.core/let [q_tail__3472 q_tail__3472 | |
q_head__3471 q_head__3471 | |
ocr-3470 (seq y) | |
z z] | |
(try (clojure.core/let [q_tail__3472 (clojure.core/rest q)] | |
(clojure.core/cond (clojure.core/empty? q_tail__3472) (clojure.core/let [] (quote a)) | |
:else (throw clojure.core.match/backtrack))) | |
(catch java.lang.Exception e__2590__auto__ | |
(if (clojure.core/identical? e__2590__auto__ clojure.core.match/backtrack) | |
(do (throw clojure.core.match/backtrack)) | |
(throw e__2590__auto__))))) | |
:else (throw clojure.core.match/backtrack)) | |
(catch java.lang.Exception e__2590__auto__ | |
(if (clojure.core/identical? e__2590__auto__ clojure.core.match/backtrack) | |
(do (clojure.core/let [] (quote b))) | |
(throw e__2590__auto__))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment