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)))])
#`(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))

View File

@ -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 ()

View File

@ -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")