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 | 780e22e8b957f7070009811523b2c7567b27b7c0 (patch) | |
tree | cf4499fd70fb3950d2de58848899d72d3216b4de /eval.c | |
parent | dbbe05f214787b6ef8f90bda8ea3458a72e3081b (diff) | |
download | txr-780e22e8b957f7070009811523b2c7567b27b7c0.tar.gz txr-780e22e8b957f7070009811523b2c7567b27b7c0.tar.bz2 txr-780e22e8b957f7070009811523b2c7567b27b7c0.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.
Diffstat (limited to 'eval.c')
-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); } } } |