Fixed GH issue #3 (again)

This commit is contained in:
Georges Dupéron 2016-03-31 13:27:54 +02:00
parent f57b1ecd06
commit 32a717c243
3 changed files with 12 additions and 8 deletions

View File

@ -19,6 +19,7 @@
(variable-reference->namespace (#%variable-reference)))]) (variable-reference->namespace (#%variable-reference)))])
#`(mod nam lang #`(mod nam lang
(modbeg (modbeg
(module code racket/base)
(module* test racket/base (module* test racket/base
(require repltest/private/run-interactions) (require repltest/private/run-interactions)
(run-interactions (open-input-string #,(port->string in)) (run-interactions (open-input-string #,(port->string in))

View File

@ -8,14 +8,15 @@
rackunit rackunit
repltest/private/util) repltest/private/util)
(define (run-interactions in-rest varref) (define-syntax-rule (run-interactions in-rest varref)
(define res-mod (begin
(module-path-index-resolve (require (prefix-in "main-mod:" (submod "..")))
(module-path-index-join '(submod "..") (define res-mod
(variable-reference->module-path-index varref)))) (module-path-index-resolve
(dynamic-require res-mod #f) (module-path-index-join '(submod "..")
(define mod-ns (module->namespace res-mod)) (variable-reference->module-path-index varref))))
(run-interactions2 in-rest mod-ns)) (define mod-ns (module->namespace res-mod))
(run-interactions2 in-rest mod-ns)))
(define (run-interactions2 in-rest mod-ns) (define (run-interactions2 in-rest mod-ns)
(let loop () (let loop ()

View File

@ -4,6 +4,8 @@
;; gobbled-up by the preceeding read. ;; gobbled-up by the preceeding read.
(define x 0) (define x 0)
(define (y) #R(- 3 2)) (define (y) #R(- 3 2))
(define-syntax (module->namespace stx) #'error)
(provide module->namespace)
'displayed 'displayed
(displayln "displayed too") (displayln "displayed too")