fix mismatch between make-base-eval' and
make-base-eval-factory'
This commit is contained in:
parent
c22c8b0846
commit
8d3aa69e9d
|
@ -3,6 +3,7 @@
|
||||||
(require "manual.rkt" "struct.rkt" "scheme.rkt" "decode.rkt"
|
(require "manual.rkt" "struct.rkt" "scheme.rkt" "decode.rkt"
|
||||||
racket/string racket/list racket/file
|
racket/string racket/list racket/file
|
||||||
racket/sandbox racket/promise racket/port file/convertible
|
racket/sandbox racket/promise racket/port file/convertible
|
||||||
|
racket/gui/dynamic
|
||||||
(for-syntax racket/base))
|
(for-syntax racket/base))
|
||||||
|
|
||||||
(provide interaction
|
(provide interaction
|
||||||
|
@ -299,7 +300,12 @@
|
||||||
e)))))
|
e)))))
|
||||||
|
|
||||||
(define (make-base-eval-factory mod-paths)
|
(define (make-base-eval-factory mod-paths)
|
||||||
(let ([ns (delay (let ([ns (make-base-empty-namespace)])
|
(let ([ns (delay (let ([ns
|
||||||
|
;; This namespace-creation choice needs to be consistent
|
||||||
|
;; with the sandbox (i.e., with `make-base-eval')
|
||||||
|
(if gui?
|
||||||
|
((gui-dynamic-require 'make-gui-empty-namespace))
|
||||||
|
(make-base-empty-namespace))])
|
||||||
(parameterize ([current-namespace ns])
|
(parameterize ([current-namespace ns])
|
||||||
(for ([mod-path (in-list mod-paths)])
|
(for ([mod-path (in-list mod-paths)])
|
||||||
(dynamic-require mod-path #f)))
|
(dynamic-require mod-path #f)))
|
||||||
|
@ -307,22 +313,22 @@
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(let ([ev (make-base-eval)]
|
(let ([ev (make-base-eval)]
|
||||||
[ns (force ns)])
|
[ns (force ns)])
|
||||||
((scribble-eval-handler)
|
(call-in-sandbox-context
|
||||||
ev #f
|
ev
|
||||||
`(,(lambda ()
|
(lambda ()
|
||||||
(for ([mod-path (in-list mod-paths)])
|
(for ([mod-path (in-list mod-paths)])
|
||||||
(namespace-attach-module ns mod-path)))))
|
(namespace-attach-module ns mod-path))))
|
||||||
ev))))
|
ev))))
|
||||||
|
|
||||||
(define (make-eval-factory mod-paths)
|
(define (make-eval-factory mod-paths)
|
||||||
(let ([base-factory (make-base-eval-factory mod-paths)])
|
(let ([base-factory (make-base-eval-factory mod-paths)])
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(let ([ev (base-factory)])
|
(let ([ev (base-factory)])
|
||||||
((scribble-eval-handler)
|
(call-in-sandbox-context
|
||||||
ev #f
|
ev
|
||||||
`(,(lambda ()
|
(lambda ()
|
||||||
(for ([mod-path (in-list mod-paths)])
|
(for ([mod-path (in-list mod-paths)])
|
||||||
(namespace-require mod-path)))))
|
(namespace-require mod-path))))
|
||||||
ev))))
|
ev))))
|
||||||
|
|
||||||
(define (close-eval e)
|
(define (close-eval e)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user