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 | cbf6b1f32c09868cb76af8f8b47fa157e6f5eb1f (patch) | |
tree | a6ba83cb2de8abad9a65e82b25b37c547e57c94b | |
parent | 2ead17138dfea8df5dccaf72eca2c47629880086 (diff) | |
download | txr-cbf6b1f32c09868cb76af8f8b47fa157e6f5eb1f.tar.gz txr-cbf6b1f32c09868cb76af8f8b47fa157e6f5eb1f.tar.bz2 txr-cbf6b1f32c09868cb76af8f8b47fa157e6f5eb1f.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.
-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; |