summaryrefslogtreecommitdiffstats
path: root/tests/011/macros-3.tl
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-05-24 07:31:16 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-05-24 07:31:16 -0700
commitbbb79a948de4688b44ba18ae37a1a6abb30e84d7 (patch)
tree6960a3e30df34e05e33beda72ae232bb889c7e2a /tests/011/macros-3.tl
parentb4f23d86dd71504405f2f26278941dd8325c14ab (diff)
downloadtxr-bbb79a948de4688b44ba18ae37a1a6abb30e84d7.tar.gz
txr-bbb79a948de4688b44ba18ae37a1a6abb30e84d7.tar.bz2
txr-bbb79a948de4688b44ba18ae37a1a6abb30e84d7.zip
label/flet: bug: empty case wallops symbol macros.
* eval.c (make_var_shadowing_env): We cannot return the original env in the empty variable case, but earnestly make a new one. This function is used by the expander when walking the lbind/fbind special from emitted by labels/flet. That form clobbers the environment via make_fun_shadowing_env, which calls make_var_shadowing_env and then destructively moves the variable bindings to the function binding slot of the environment. The manifestation is that when we have (symacrolet ((x 1)) (labels () x)), the x fails to expand; it has been wrongly moved to the function bindings area of the macro environment.
Diffstat (limited to 'tests/011/macros-3.tl')
-rw-r--r--tests/011/macros-3.tl5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/011/macros-3.tl b/tests/011/macros-3.tl
index 9a595021..fda312da 100644
--- a/tests/011/macros-3.tl
+++ b/tests/011/macros-3.tl
@@ -18,3 +18,8 @@
(mtest s 1
s 2
s 3)
+
+(test (symacrolet ((a 42))
+ (labels ()
+ a))
+ 42)