[plt-scheme] identifier for a module-body definition already has a different module context
Hi,
I'm trying to compose some macros and I'm running into an unexpected
error message.
(module b mzscheme
(provide def-b)
(define-syntax (def-b stx)
(syntax-case stx ()
[(_ val)
(with-syntax ([b (datum->syntax-object stx 'b)])
#`(define b val))])))
(module b5 mzscheme
(require b)
(provide def-b5)
(define-syntax (def-b5 stx)
(syntax-case stx ()
[(_)
#`(def-b 5)])))
> (require b5)
> (def-b5)
define-values: identifier for a top-level definition already has a
module context in: b
I thought 'b' had the macro invocation (stx) context... Am I
assigning the wrong context in the datum->syntax-object call?
Daniel