From 178d094e6ac280ef26762a1b60fae8e3d8b501cf Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 24 Nov 2016 05:42:10 -0800 Subject: bugfix: indicator params absent from macro envs. The problem is about those Boolean parameters which indicate whether their associated optional parameters are present: in (lambda (: (opt-parm 42 opt-parm-p))), such a parameter is opt-parm-p. When parameter lists are walked by the macro expander, these parameters are not being included as shadow entries in macro-time parameter lists. Thus if opt-parm-p happens to shadow an outer symbol macro, that symbol macro will be expanded anyway. * eval.c (get_opt_param_syms): Function now lists those additional parameters. --- eval.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/eval.c b/eval.c index ba6b99fc..8ed31f10 100644 --- a/eval.c +++ b/eval.c @@ -838,8 +838,11 @@ static val get_opt_param_syms(val params) return cons(spec, rest_syms); return rest_syms; } else { - val pat = car(spec); - return nappend2(get_param_syms(pat), get_opt_param_syms(cdr(params))); + val pat_var = car(spec); + val pat_p_var = caddr(spec); + val syms = nappend2(get_param_syms(pat_p_var), + get_opt_param_syms(cdr(params))); + return nappend2(get_param_syms(pat_var), syms); } } } -- cgit v1.2.3