Closed jhidding closed 8 years ago
The issue is somewhat fixed when I add `(define extra-keyword #f) to the library and export it. I ran into this when trying to use srfi-26 with chez.
This is a consequence of the interaction-environment semantics, and your solution is the recommended one.
@jhidding Another way to handle this (which is what I do in the nanopass framework) is to use define-syntax to create an identifier for auxiliary keyword and export it with your library. I do something like:
(define-syntax extra-keyword
(lambda (x)
(syntax-violation #f "misplaced use of auxiliary keyword" x)))
and then add extra-keyword
to your export list.
I actually have a couple of macros I wrote to make this easier (and to make it clear what I'm doing):
(define-syntax define-auxiliary-keyword
(syntax-rules ()
[(_ name)
(define-syntax name
(lambda (x)
(syntax-violation #f "misplaced use of auxiliary keyword" x)))]))
(define-syntax define-auxiliary-keywords
(syntax-rules ()
[(_ name* ...)
(begin (define-auxiliary-keyword name*) ...)]))
Thanks!
Example::
When I use this code with (import (test1)), it fails, while the same code works when used inside the same module.