diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-11-25 23:31:30 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-11-25 23:31:30 -0800 |
commit | 1f959abcf7cc1d18401d440b42761ac0b1babb78 (patch) | |
tree | a6ba83cb2de8abad9a65e82b25b37c547e57c94b /eval.c | |
parent | 2e04358bf8798638c6c16344f55273bc06297ec6 (diff) | |
download | txr-1f959abcf7cc1d18401d440b42761ac0b1babb78.tar.gz txr-1f959abcf7cc1d18401d440b42761ac0b1babb78.tar.bz2 txr-1f959abcf7cc1d18401d440b42761ac0b1babb78.zip |
bugfix: dohash expander not making shadowing env.
* eval.c (do_expand): When a dohash special form is
expanded, a macro shadowing environment must be
created for the two variables that it binds and the
body must be expanded in that environment, to
protect the variables from symbol macros.
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -3785,7 +3785,8 @@ static val do_expand(val form, val menv) val body = rest(rest(form)); val hashform_ex = expand(hashform, menv); val resform_ex = expand(resform, menv); - val body_ex = expand_progn(body, menv); + val new_menv = make_var_shadowing_env(menv, list(keysym, valsym, nao)); + val body_ex = expand_progn(body, new_menv); if (hashform == hashform_ex && resform == resform_ex && body == body_ex) return form; |