[plt-scheme] identifier for a module-body definition already has a different module context

From: Daniel Pinto de Mello e Silva (daniel.silva at gmail.com)
Date: Sun Dec 26 14:51:03 EST 2004

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?


Posted on the users mailing list.