diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-11-14 07:13:03 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-11-18 14:26:19 -0800 |
commit | c0dd2645afdc2aac8bfb6f331a7d9344c4982c15 (patch) | |
tree | c8f1ed07bab540f6548cc9a822eab5f6599a99dd /LICENSE-CYG | |
parent | 57867881e31273f91c398b55f75417484f11ddc0 (diff) | |
download | txr-c0dd2645afdc2aac8bfb6f331a7d9344c4982c15.tar.gz txr-c0dd2645afdc2aac8bfb6f331a7d9344c4982c15.tar.bz2 txr-c0dd2645afdc2aac8bfb6f331a7d9344c4982c15.zip |
eval: bugfix: expansion wrongly always in null env.
The eval function uses a null macro environment for expanding
a form, even when it's given an environment object. This
causes spurious warnings about unbound variables/functions.
For instance:
(let ((env (make-env '((x . 42)) nil nil)))
(eval '(+ x x) env)) ;; warning: unbound variable x
To fix this, we have to create a macro version of the
incoming environment and expand with that.
* eval.c (env_to_menv): Take an evaluation environment chain
and convert it to a (flattened) macro environment.
(expand_eval): Take a macro environment parameter and use
that for expanding the form to be evaluated, rather than nil.
(eval_intrinsic): Calculate a macro environment corresponding
to the given evaluation environment. Use that for the
macroexpand call, and also pass it down to expand_eval
to be used for the full expansion.
Diffstat (limited to 'LICENSE-CYG')
0 files changed, 0 insertions, 0 deletions