summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-11-24 05:42:10 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-11-24 05:42:10 -0800
commit178d094e6ac280ef26762a1b60fae8e3d8b501cf (patch)
treecf4499fd70fb3950d2de58848899d72d3216b4de
parent743af8b21d53b68a30ab560d9c87a68686711097 (diff)
downloadtxr-178d094e6ac280ef26762a1b60fae8e3d8b501cf.tar.gz
txr-178d094e6ac280ef26762a1b60fae8e3d8b501cf.tar.bz2
txr-178d094e6ac280ef26762a1b60fae8e3d8b501cf.zip
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.
-rw-r--r--eval.c7
1 files 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);
}
}
}