Created
December 8, 2011 22:46
-
-
Save egamble/1449057 to your computer and use it in GitHub Desktop.
Recursively macroexpand to depth n
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
(defn macroexpand-n [n form] | |
(if (zero? n) | |
form | |
(recur (dec n) | |
(macroexpand-1 form)))) |
amalloy
commented
Dec 9, 2011
Cool, thanks!
…On Thu, Dec 8, 2011 at 9:55 PM, Alan Malloy < ***@***.*** > wrote:
``` clojure
(defn macroexpand-n [n form]
(nth (iterate macroexpand-1 form) n))
```
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/1449057
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment