summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--share/txr/stdlib/compiler.tl14
1 files changed, 8 insertions, 6 deletions
diff --git a/share/txr/stdlib/compiler.tl b/share/txr/stdlib/compiler.tl
index aafbf5f0..a4721448 100644
--- a/share/txr/stdlib/compiler.tl
+++ b/share/txr/stdlib/compiler.tl
@@ -1277,13 +1277,15 @@
(defun expand-defmacro (form)
(mac-param-bind form (op name mac-args . body) form
- (with-gensyms (form menv)
+ (with-gensyms (form menv spine-iter)
(let ((exp-lam ^(lambda (,form ,menv)
- (mac-param-bind ,form ,mac-args (cdr ,form)
- (sys:set-macro-ancestor
- (block ,name
- ,*body)
- ,form)))))
+ (let ((,spine-iter (cdr ,form)))
+ ,(expand (expand-bind-mac-params form form mac-args
+ menv spine-iter
+ t nil
+ ^((sys:set-macro-ancestor
+ (block ,name ,*body)
+ ,form))))))))
^(progn
(sys:rt-defmacro ',name '(macro ,name) ,exp-lam)
',name)))))