diff --git a/collects/scribble/eval.ss b/collects/scribble/eval.ss index 765793bb..309764eb 100644 --- a/collects/scribble/eval.ss +++ b/collects/scribble/eval.ss @@ -23,6 +23,7 @@ as-examples make-base-eval + close-eval scribble-eval-handler) @@ -244,6 +245,10 @@ [sandbox-eval-limits #f] [sandbox-make-inspector current-inspector]) (make-evaluator '(begin (require scheme/base))))) + + (define (close-eval e) + (kill-evaluator e) + "") (define (do-plain-eval ev s catching-exns?) (call-with-values (lambda () diff --git a/collects/scribblings/scribble/eval.scrbl b/collects/scribblings/scribble/eval.scrbl index e6b4df83..31231965 100644 --- a/collects/scribblings/scribble/eval.scrbl +++ b/collects/scribblings/scribble/eval.scrbl @@ -93,6 +93,13 @@ setting sandbox parameters to disable limits, set the outputs to @scheme['string], and not add extra security guards.} +@defproc[(close-eval [eval (any/c . -> . any)]) (one-of/c "")]{ + +Shuts down an evaluator produced by @scheme[make-base-eval]. Use +@scheme[close-eval] when garbage collection cannot otherwise reclaim +an evaluator (e.g., because it is defined in a module body).} + + @defparam[scribble-eval-handler handler ((any/c . -> . any) any/c boolean? . -> . any)]{