From 338c195e81c77bd11dbebf3279ce5a78b7c39540 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Thu, 18 Jan 2018 18:41:07 -0500 Subject: [PATCH] Keep local renames with define-syntax and letrec-syntax macros --- scheme/eval.sld | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scheme/eval.sld b/scheme/eval.sld index f352140f..28220f59 100644 --- a/scheme/eval.sld +++ b/scheme/eval.sld @@ -978,7 +978,7 @@ ;; Keep track of macros added during compilation. ;; TODO: why in both places? (macro:add! name body) - (env:define-variable! name (list 'macro body) env))) + (env:define-variable! name (list 'macro body local-renamed) env))) ;; Keep as a 'define' form so available at runtime ;; TODO: may run into issues with expanding now, before some ;; of the macros are defined. may need to make a special pass @@ -1035,7 +1035,8 @@ 'macro (if (macro:syntax-rules? (env:lookup (car binding) body-env #f)) (cadr (_expand binding body-env rename-env local-env local-renamed)) - binding-body)))) + binding-body) + local-renamed))) (env:define-variable! name macro-val) body-env)) bindings) (_expand body body-env rename-env local-env local-renamed)