I'm not sure why, but this works:
(unit
(import foo^)
(export bar^)
(+ foo bar)))
while this fails:
(define-syntax-rule (asyn body ...)
(unit
(import foo^)
(export bar^)
body ...))
(asyn (+ foo bar))
with the error "unit: undefined export" for any imported variables.
Your example is similar to
(define-syntax-rule (with-x body)
(let ([x 5])
body))
(with-x x) ; => unbound identifier
That is, `import` is a binding form, just like `let`. Bindings
introduced by a hygienic macro do not capture identifiers at the
macro-use site.
If you want non-hygienic
On Saturday, November 28, 2015 at 11:24:28 PM UTC, Matthew Flatt wrote:
> That is, `import` is a binding form, just like `let`.
Oh, that makes sense. So it gets swapped in the macro for a hygenic named
variable, and the ones I pass by that name don't get swapped in the same
fashion, thus aren't
3 matches
Mail list logo