diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2018-03-31 13:28:22 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2018-03-31 13:28:22 -0700 |
commit | d934a3e1fc57f3efcdd772ae2822efc845e74468 (patch) | |
tree | 73c173043e2aacd33e407e5112c748f1281542fc | |
parent | 12bd2bfc9aaa72cb325428f898cf0cbdd4b6c8ab (diff) | |
download | txr-d934a3e1fc57f3efcdd772ae2822efc845e74468.tar.gz txr-d934a3e1fc57f3efcdd772ae2822efc845e74468.tar.bz2 txr-d934a3e1fc57f3efcdd772ae2822efc845e74468.zip |
expander: bugfix: fixed params visible to optionals.
* eval.c (expand_params_rec): Add the parameter to the macro-time
environment before processing rest of parameter list. This is
already done for all the symbols of a macro-style
destructuring; just not for a simple parameter. This is
necessary, because the init forms of optional parameters occur
in a lexical environment in which prior parameters are
visible. The test case for this is that (lambda (x : (y x)))
must not produce a warning about unbound x.
-rw-r--r-- | eval.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -994,6 +994,7 @@ static val expand_params_rec(val params, val menv, not_bindable_error(form, param); } else { param_ex = param; + new_menv = make_var_shadowing_env(menv, cons(param, nil)); } { |