diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-11-24 05:42:10 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-11-24 05:42:10 -0800 |
commit | 178d094e6ac280ef26762a1b60fae8e3d8b501cf (patch) | |
tree | cf4499fd70fb3950d2de58848899d72d3216b4de | |
parent | 743af8b21d53b68a30ab560d9c87a68686711097 (diff) | |
download | txr-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.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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); } } } |