mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-21 22:59:16 +02:00
Keep local renames with define-syntax and letrec-syntax macros
This commit is contained in:
parent
7710bbfd9d
commit
338c195e81
1 changed files with 3 additions and 2 deletions
|
@ -978,7 +978,7 @@
|
||||||
;; Keep track of macros added during compilation.
|
;; Keep track of macros added during compilation.
|
||||||
;; TODO: why in both places?
|
;; TODO: why in both places?
|
||||||
(macro:add! name body)
|
(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
|
;; Keep as a 'define' form so available at runtime
|
||||||
;; TODO: may run into issues with expanding now, before some
|
;; TODO: may run into issues with expanding now, before some
|
||||||
;; of the macros are defined. may need to make a special pass
|
;; of the macros are defined. may need to make a special pass
|
||||||
|
@ -1035,7 +1035,8 @@
|
||||||
'macro
|
'macro
|
||||||
(if (macro:syntax-rules? (env:lookup (car binding) body-env #f))
|
(if (macro:syntax-rules? (env:lookup (car binding) body-env #f))
|
||||||
(cadr (_expand binding body-env rename-env local-env local-renamed))
|
(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))
|
(env:define-variable! name macro-val) body-env))
|
||||||
bindings)
|
bindings)
|
||||||
(_expand body body-env rename-env local-env local-renamed)
|
(_expand body body-env rename-env local-env local-renamed)
|
||||||
|
|
Loading…
Add table
Reference in a new issue