Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macro defining macro failure case #1064

Open
shirok opened this issue Aug 11, 2024 · 0 comments
Open

Macro defining macro failure case #1064

shirok opened this issue Aug 11, 2024 · 0 comments

Comments

@shirok
Copy link
Owner

shirok commented Aug 11, 2024

ER macro's rename procedure takes a quoted symbol. When the inner macro want to refer to the local variable introduced by outer macro, and that local variable is effectively renamed, it fails to do so, since quoting strips off the outer renaming info.

Example:

(define-syntax foo
  (syntax-rules ()
    [(_) (let ((vah 1))
           (let-syntax ([bar (er-macro-transformer
                              (^[f r c] (r'vah)))])
             (bar)))]))

The renaming info of outer vah is stripped when we pass 'var to the rename proc.

It works if two vahs are renamed at the same time, that is, both are syntax-rules transformer, or the inner macro doesn't use inner rename procedure but use the outer rename procedure. Typical use case can be covered by that. But that's not always the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant