diff --git a/lang/reader.rkt b/lang/reader.rkt index 11bb6a1..391d8a1 100644 --- a/lang/reader.rkt +++ b/lang/reader.rkt @@ -19,6 +19,7 @@ (variable-reference->namespace (#%variable-reference)))]) #`(mod nam lang (modbeg + (module code racket/base) (module* test racket/base (require repltest/private/run-interactions) (run-interactions (open-input-string #,(port->string in)) diff --git a/private/run-interactions.rkt b/private/run-interactions.rkt index 5e481d0..e002d78 100644 --- a/private/run-interactions.rkt +++ b/private/run-interactions.rkt @@ -8,14 +8,15 @@ rackunit repltest/private/util) -(define (run-interactions in-rest varref) - (define res-mod - (module-path-index-resolve - (module-path-index-join '(submod "..") - (variable-reference->module-path-index varref)))) - (dynamic-require res-mod #f) - (define mod-ns (module->namespace res-mod)) - (run-interactions2 in-rest mod-ns)) +(define-syntax-rule (run-interactions in-rest varref) + (begin + (require (prefix-in "main-mod:" (submod ".."))) + (define res-mod + (module-path-index-resolve + (module-path-index-join '(submod "..") + (variable-reference->module-path-index varref)))) + (define mod-ns (module->namespace res-mod)) + (run-interactions2 in-rest mod-ns))) (define (run-interactions2 in-rest mod-ns) (let loop () diff --git a/test/meta.rkt b/test/meta.rkt index f813ccb..43858d0 100644 --- a/test/meta.rkt +++ b/test/meta.rkt @@ -4,6 +4,8 @@ ;; gobbled-up by the preceeding read. (define x 0) (define (y) #R(- 3 2)) +(define-syntax (module->namespace stx) #'error) +(provide module->namespace) 'displayed (displayln "displayed too")