summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--eval.c8
-rw-r--r--txr.113
2 files changed, 19 insertions, 2 deletions
diff --git a/eval.c b/eval.c
index 313eabe1..1114846b 100644
--- a/eval.c
+++ b/eval.c
@@ -3821,8 +3821,12 @@ static val do_expand(val form, val menv)
body, body_ex)))), form);
} else if (sym == macro_time_s) {
val args = rest(form);
- val args_ex = expand_forms(args, menv);
- val result = eval_progn(args_ex, make_env(nil, nil, nil), args);
+ val result = nil;
+ for (; args; args = cdr(args)) {
+ val arg = car(args);
+ val arg_ex = expand(arg, menv);
+ result = eval(arg_ex, nil, args);
+ }
return maybe_quote(result);
} else if (sym == macrolet_s) {
return expand_macrolet(form, menv);
diff --git a/txr.1 b/txr.1
index 9376d51a..f01e2537 100644
--- a/txr.1
+++ b/txr.1
@@ -27262,6 +27262,19 @@ The special behavior of
is that the evaluation takes place during
the expansion phase, rather than during the evaluation phase.
+Also,
+.code macro-time
+macro-expands each
+.meta form
+and evaluates it before processing the next
+.meta form
+in the same way. Thus, for instance, if a
+.meta form
+introduces a global definition, that definition will be visible not
+only during the evaluation of a subsequent
+.metn form ,
+but also during its macro-expansion time.
+
During the expansion phase, all
.code macro-time
expressions which occur in a context