我工作的一个宏,我试图找出如何避免某些形式的扩张,采取以下和宏观例如,Clojure的宏扩展
(defmacro and
([] true)
([x] x)
([x & next]
`(let [and# ~x]
(if and# (and [email protected]) and#))))
展开时,
(mexpand-all '(and 1 2 3))
变,
(let* [and__973__auto__ 1]
(if and__973__auto__
(let* [and__973__auto__ 2]
(if and__973__auto__ 3 and__973__auto__))
and__973__auto__))
在这种情况下,我需要做的是停止从扩大到让*让。
我想要做的是递归地扩展除let形式之外的所有东西。顺便说一句,mexpand来自contrib macro-utils – 2011-05-13 02:26:05