#lang racket/base ;; Define a module (require (for-syntax racket/base)) ;; Use require/expose (when doesn't seem to matter) (begin-for-syntax (require (only-in rackunit require/expose)) (require/expose racket/base (cons))) ;; Define a macro that uses a phase-1 definition. ;; Doesn't seem to matter what the macro does, or if it is even used. (define-syntax (m syn) (syntax-case syn () [(_) (do-something-at-phase-1) #'(void)])) ;; Define that definition *after* defining the macro. (order seems to be critical here). ;; Doesn't seem to matter whether the definition is a function or a constant. (begin-for-syntax (define (do-something-at-phase-1) (displayln "meow"))) ;; Import the module. ;; Doesn't matter if the macro is used in the module. (module+ test (require (submod ".."))) ;; Get the following error, in DrRacket, but not on the commandline or in emacs-mode #| require: namespace mismatch; reference to a module that is not available reference phase: 1 referenced module: 'expanded module referenced phase level: 1 in: do-something-at-phase-1 |# ;; this line not required to reproduce; (m)