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

Error during macro expansion when referencing another non-exported variable from library #208

Open
SaitoAtsushi opened this issue Mar 2, 2016 · 1 comment

Comments

@SaitoAtsushi
Copy link

This is similar to #162

(define-library (foo)
  (export bar)
  (import (scheme base))
  (begin 
    (define (baz) #f)
    (define-syntax bar
      (syntax-rules ()
        ((_) (baz))))
    ))
(import (scheme base)
        (foo))
(bar)
$ huski test.scm
Getting an unbound variable: baz
@justinethier
Copy link
Owner

Thanks for the bug report.

Well, the macro transforms the expression into baz and then that identifier is not found. It seems it should have been, though, based on r7rs:

If a macro transformer inserts a free reference to an
identifier, the reference refers to the binding that was
visible where the transformer was specified, regardless
of any local bindings that surround the use of the
macro.

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

2 participants