From 1cafc3e511b19f22ad6eb8c49c3f4cd7f87ece6a Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 7 Apr 2016 23:25:13 -0700 Subject: Allow symbol macro in function call dot position. * eval.c (expand_forms): If the forms list is an atom, then don't just return it. Try to expand it as a macro. If the macro produces a compound form, diagnose with an exception, otherwise return the expansion. * txr.1: Document the treatment of symbol macros in function call dot position. --- eval.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 28a7a921..0133caea 100644 --- a/eval.c +++ b/eval.c @@ -2459,7 +2459,11 @@ static val me_quasilist(val form, val menv) val expand_forms(val form, val menv) { if (atom(form)) { - return form; + val ex_f = expand(form, menv); + if (consp(ex_f)) + uw_throwf(error_s, lit("symbol macro ~s in dot position must produce " + "atom form, not compound"), form, nao); + return ex_f; } else { val f = car(form); val r = cdr(form); -- cgit v1.2.3