diff options
author | Stuart Sierra <mail@stuartsierra.com> | 2009-01-17 22:55:21 +0000 |
---|---|---|
committer | Stuart Sierra <mail@stuartsierra.com> | 2009-01-17 22:55:21 +0000 |
commit | 945c38cf2000494b3f7697ab9c12a1ce12c7ab00 (patch) | |
tree | 91bc9929a32f6ad6b68a0152fd84d1789c9f36f1 /src/clojure/contrib/walk.clj | |
parent | a227224a71f949935dbbdb6ddba4660699f51825 (diff) |
walk.clj: added macroexpand-all, a simple demonstration of a walking function
Diffstat (limited to 'src/clojure/contrib/walk.clj')
-rw-r--r-- | src/clojure/contrib/walk.clj | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/clojure/contrib/walk.clj b/src/clojure/contrib/walk.clj index 6a6e06e2..5c1e9a3e 100644 --- a/src/clojure/contrib/walk.clj +++ b/src/clojure/contrib/walk.clj @@ -114,3 +114,9 @@ replacement at the leaves of the tree first." [smap form] (postwalk (fn [x] (if (contains? smap x) (smap x) x)) form)) + +(defn macroexpand-all + "Recursively performs all possible macroexpansions in form." + [form] + (prewalk (fn [x] (if (list? x) (macroexpand x) x)) form)) + |