http://www.ccs.neu.edu/home/ryanc/macro-patterns/error_unbound-in-transformer-env.html
7.1 Unbound identifier in transformer environment
compile: unbound identifier in transformer environment (and no #%app syntax transformer is bound) in: syntax-case
compile: bad syntax; function application is not allowed, because no #%app syntax transformer is bound in: (syntax-case ___)
Usually, this means that you forgot to require scheme/base for-syntax. The scheme/base language does not provide a transformer-environment (aka for-syntax, phase 1) binding for syntax-case (or lambda, or anything else except for syntax-rules). So when the compiler encounters (syntax-case __), since it doesn’t find a phase-1 binding for syntax-case, it figures that the expression must be a function call instead. Then it looks for a binding of #%app, fails to find it, and reports that error.
(module m scheme/base |
(define-syntax (my-macro stx) |
(syntax-case stx () |
__))) |
(module m scheme/base |
(require (for-syntax scheme/base)) |
(define-syntax (my-macro stx) |
(syntax-case stx () |
__))) |
(module m scheme |
(define-syntax (my-macro stx) |
(syntax-case stx () |
__))) |
If the expression the error refers to doesn’t look like the body of a macro or static info expression (see Static Information), then continue to the next section.
7.1.1 Alternative causes
Another way to get this error is to neglect to require scheme/base for-template in a code generator module (see Code Generators). The macro expander goes through the same process as above, but at a different phase.
'Programming' 카테고리의 다른 글
Download a file from the internet using Perl (0) | 2014.09.25 |
---|---|
Continuations and tail recursion (0) | 2014.06.24 |
Go 언어에서 package name 충돌 해결방법 (0) | 2014.05.18 |
Proceedings of ELS 2014 - 7th European Lisp Symposium (0) | 2014.05.13 |
An Incremental Approach to Compiler Construction (0) | 2014.05.09 |