Skip to content

Instantly share code, notes, and snippets.

@zeroem
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeroem/8aaf26fb33a657072d73 to your computer and use it in GitHub Desktop.
Save zeroem/8aaf26fb33a657072d73 to your computer and use it in GitHub Desktop.
(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