Last active
August 29, 2015 14:01
-
-
Save zeroem/8aaf26fb33a657072d73 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
(defmacro foo [v & body] `(let [l# 5 ~@(mapcat (fn [b] [b `l#]) v)] ~@body)) | |
(clojure.pprint/pprint (macroexpand-1 '(foo [a b c] (println a b c)))) | |
;; NOTE: both uses of l# in the macro get a different gensym | |
(clojure.core/let | |
[l__4243__auto__ | |
5 | |
a | |
l__4242__auto__ | |
b | |
l__4242__auto__ | |
c | |
l__4242__auto__] | |
(println a b c)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment