diff --git a/collects/scribble/eval.ss b/collects/scribble/eval.ss index 765793bb08..309764eb04 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/guide/class.scrbl b/collects/scribblings/guide/class.scrbl index a10d5569b4..15d7c707c3 100644 --- a/collects/scribblings/guide/class.scrbl +++ b/collects/scribblings/guide/class.scrbl @@ -799,3 +799,7 @@ Using this form in conjunction with trait operators such as (define/public (get-color) .... (get-spots-color) .... (get-stripes-color) ....)))) ] + +@; ---------------------------------------------------------------------- + +@close-eval[class-eval] diff --git a/collects/scribblings/guide/control.scrbl b/collects/scribblings/guide/control.scrbl index b1ec99caca..de627779bb 100644 --- a/collects/scribblings/guide/control.scrbl +++ b/collects/scribblings/guide/control.scrbl @@ -264,3 +264,7 @@ For an example of how @tech{continuations} are useful, see @other-manual['(lib "scribblings/more/more.scrbl")]. For specific control operators that have more convenient names than the primitives described here, see @schememodname[scheme/control]. + +@; ---------------------------------------------------------------------- + +@close-eval[cc-eval] diff --git a/collects/scribblings/guide/define-struct.scrbl b/collects/scribblings/guide/define-struct.scrbl index 45b19059d7..627a42bf37 100644 --- a/collects/scribblings/guide/define-struct.scrbl +++ b/collects/scribblings/guide/define-struct.scrbl @@ -490,3 +490,5 @@ A @scheme[_struct-option] always starts with a keyword: @; ---------------------------------------- @refdetails["structures"]{structure types} + +@close-eval[posn-eval] diff --git a/collects/scribblings/guide/define.scrbl b/collects/scribblings/guide/define.scrbl index 8dd3541f41..7ba257275b 100644 --- a/collects/scribblings/guide/define.scrbl +++ b/collects/scribblings/guide/define.scrbl @@ -257,3 +257,7 @@ in the next section). However, other definition forms can appear as a @secref["macros"]). @refdetails/gory["intdef-body"]{internal definitions} + +@; ---------------------------------------------------------------------- + +@close-eval[def-eval] diff --git a/collects/scribblings/guide/io.scrbl b/collects/scribblings/guide/io.scrbl index 62b3e13692..79bb19e5c5 100644 --- a/collects/scribblings/guide/io.scrbl +++ b/collects/scribblings/guide/io.scrbl @@ -412,3 +412,9 @@ immediately if that's all that is available: (copy-port (open-input-string "broom") o) (get-output-string o) ] + +@close-eval[port-eval] + +@; ---------------------------------------------------------------------- + +@close-eval[io-eval] diff --git a/collects/scribblings/guide/lambda.scrbl b/collects/scribblings/guide/lambda.scrbl index 14c1d65ed6..dc30c7b4a9 100644 --- a/collects/scribblings/guide/lambda.scrbl +++ b/collects/scribblings/guide/lambda.scrbl @@ -237,3 +237,7 @@ case that matches the number of given arguments. A @scheme[case-lambda] function cannot directly support optional or keyword arguments. + +@; ---------------------------------------------------------------------- + +@close-eval[greet-eval] diff --git a/collects/scribblings/guide/lists.scrbl b/collects/scribblings/guide/lists.scrbl index 637b0147e7..a908eb746b 100644 --- a/collects/scribblings/guide/lists.scrbl +++ b/collects/scribblings/guide/lists.scrbl @@ -344,3 +344,7 @@ directly, so the tail-call ``optimization'' kicks in: #,step (cons "a" (list "b")) #,step (list "a" "b") ] + +@; ---------------------------------------------------------------------- + +@close-eval[list-eval] diff --git a/collects/scribblings/guide/match.scrbl b/collects/scribblings/guide/match.scrbl index 42e412a134..42eb3e1512 100644 --- a/collects/scribblings/guide/match.scrbl +++ b/collects/scribblings/guide/match.scrbl @@ -120,3 +120,5 @@ pattern variables can be bound to lists of lists of matches: ] For information on many more pattern forms, see @schememodname[scheme/match]. + +@close-eval[match-eval] diff --git a/collects/scribblings/guide/module-syntax.scrbl b/collects/scribblings/guide/module-syntax.scrbl index 3ec76e7ad0..4c614fbb59 100644 --- a/collects/scribblings/guide/module-syntax.scrbl +++ b/collects/scribblings/guide/module-syntax.scrbl @@ -117,3 +117,7 @@ Unless otherwise specified, a module that is documented as a @scheme[module] in the same way as @schememodfont{#lang} @schememodname[scheme]. The documented language name can be used directly with @scheme[module] or @scheme[require], too. + +@; ---------------------------------------------------------------------- + +@close-eval[cake-eval] diff --git a/collects/scribblings/guide/proc-macros.scrbl b/collects/scribblings/guide/proc-macros.scrbl index 8e47bf0ace..b76a5ec6d8 100644 --- a/collects/scribblings/guide/proc-macros.scrbl +++ b/collects/scribblings/guide/proc-macros.scrbl @@ -460,3 +460,5 @@ defines the macro. @; ---------------------------------------- @include-section["certificates.scrbl"] + +@close-eval[check-eval] diff --git a/collects/scribblings/guide/regexp.scrbl b/collects/scribblings/guide/regexp.scrbl index 4e5a938e54..b46fbdef1b 100644 --- a/collects/scribblings/guide/regexp.scrbl +++ b/collects/scribblings/guide/regexp.scrbl @@ -952,3 +952,5 @@ The regexp @scheme[ip-re] will match all and only valid IP addresses. (regexp-match ip-re "1.2.3.4") (regexp-match ip-re "0.0.0.0") ] + +@close-eval[ex-eval] diff --git a/collects/scribblings/guide/simple-syntax.scrbl b/collects/scribblings/guide/simple-syntax.scrbl index 7075d924ce..11fe283d9b 100644 --- a/collects/scribblings/guide/simple-syntax.scrbl +++ b/collects/scribblings/guide/simple-syntax.scrbl @@ -597,3 +597,7 @@ use earlier bindings: [z (+ x y)]) (format "adding ~s and ~s produces ~s" x y z)) ] + +@; ---------------------------------------------------------------------- + +@close-eval[ex-eval] diff --git a/collects/scribblings/guide/truth.scrbl b/collects/scribblings/guide/truth.scrbl index 244603c69c..dee7097e82 100644 --- a/collects/scribblings/guide/truth.scrbl +++ b/collects/scribblings/guide/truth.scrbl @@ -40,6 +40,8 @@ and @scheme[cdr] is pronounced ``could-er.'') (pair? (list 1 2 3)) ] +@close-eval[list-eval] + Scheme's pair datatype and its relation to lists is essentially a historical curiosity, along with the dot notation for printing and the funny names @scheme[car] and @scheme[cdr]. Pairs are deeply wired into diff --git a/collects/scribblings/guide/unit.scrbl b/collects/scribblings/guide/unit.scrbl index ddc8db72b3..b00a1896b5 100644 --- a/collects/scribblings/guide/unit.scrbl +++ b/collects/scribblings/guide/unit.scrbl @@ -510,3 +510,6 @@ use @scheme[unit] when you need to parameterize code over functions, datatypes, and classes, and when the parameterized code itself provides definitions to be linked with other parameterized code. +@; ---------------------------------------------------------------------- + +@close-eval[toy-eval] diff --git a/collects/scribblings/guide/welcome.scrbl b/collects/scribblings/guide/welcome.scrbl index c11e185c04..dde5dfa79e 100644 --- a/collects/scribblings/guide/welcome.scrbl +++ b/collects/scribblings/guide/welcome.scrbl @@ -218,3 +218,7 @@ which Scheme and Lisp implementations have historically fought with ad hoc command-line flags, compiler directives, and build tools. The module system is to designed to avoid the problems, so start with @hash-lang[], and you'll be happier with PLT Scheme in the long run. + +@; ---------------------------------------------------------------------- + +@close-eval[piece-eval] diff --git a/collects/scribblings/reference/class.scrbl b/collects/scribblings/reference/class.scrbl index 6fcd7faaae..9d57b15915 100644 --- a/collects/scribblings/reference/class.scrbl +++ b/collects/scribblings/reference/class.scrbl @@ -1713,3 +1713,5 @@ a method that is not supplied by an object. @; ---------------------------------------------------------------------- @include-section["surrogate.scrbl"] + +@close-eval[class-eval] diff --git a/collects/scribblings/reference/define-struct.scrbl b/collects/scribblings/reference/define-struct.scrbl index b9402673dd..e9e01a3547 100644 --- a/collects/scribblings/reference/define-struct.scrbl +++ b/collects/scribblings/reference/define-struct.scrbl @@ -190,3 +190,7 @@ and the only constraint on the form is that it starts with some (set-posn-x! (make-posn 1 2) 0) (define-xy-struct posn #:bad-option) ]} + +@; ---------------------------------------- + +@close-eval[posn-eval] diff --git a/collects/scribblings/reference/dicts.scrbl b/collects/scribblings/reference/dicts.scrbl index c44764164e..8f363c9132 100644 --- a/collects/scribblings/reference/dicts.scrbl +++ b/collects/scribblings/reference/dicts.scrbl @@ -466,3 +466,8 @@ mappings are the same when keys and values are compared with (dict-set! h 1 'one) (dict-ref h "1") ]} + +@; ---------------------------------------------------------------------- + +@close-eval[dict-eval] + diff --git a/collects/scribblings/reference/match.scrbl b/collects/scribblings/reference/match.scrbl index 728386f4f4..91523f8cd1 100644 --- a/collects/scribblings/reference/match.scrbl +++ b/collects/scribblings/reference/match.scrbl @@ -433,3 +433,7 @@ A transformer produced by a second @scheme[proc-expr] subexpression is A parameter that determines the comparison procedure used to check whether multiple uses of an identifier match the ``same'' value. The default is @scheme[equal?].} + +@; ---------------------------------------------------------------------- + +@close-eval[match-eval] diff --git a/collects/scribblings/reference/numbers.scrbl b/collects/scribblings/reference/numbers.scrbl index 9907d1a13c..52939c99df 100644 --- a/collects/scribblings/reference/numbers.scrbl +++ b/collects/scribblings/reference/numbers.scrbl @@ -858,3 +858,7 @@ Returns the hyperbolic sine of @scheme[z].} @defproc[(cosh [z number?]) number?]{ Returns the hyperbolic cosine of @scheme[z].} + +@; ---------------------------------------------------------------------- + +@close-eval[math-eval] diff --git a/collects/scribblings/reference/pairs.scrbl b/collects/scribblings/reference/pairs.scrbl index c231268bd7..1b1e2e2aae 100644 --- a/collects/scribblings/reference/pairs.scrbl +++ b/collects/scribblings/reference/pairs.scrbl @@ -634,6 +634,8 @@ returns @scheme[#f]. (filter-not even? '(1 2 3 4 5 6)) ]} +@close-eval[list-eval] + @; ---------------------------------------- @section{Immutable Cyclic Data} diff --git a/collects/scribblings/reference/procedures.scrbl b/collects/scribblings/reference/procedures.scrbl index 9394c42ad3..6d99597620 100644 --- a/collects/scribblings/reference/procedures.scrbl +++ b/collects/scribblings/reference/procedures.scrbl @@ -468,6 +468,7 @@ arguments, and following steps add arguments to the left of these. @examples[#:eval fun-eval (map (curryr list 'foo) '(1 2 3)) -] +]} -} + +@close-eval[fun-eval] diff --git a/collects/scribblings/reference/sandbox.scrbl b/collects/scribblings/reference/sandbox.scrbl index eec3c930c8..bf6405cb57 100644 --- a/collects/scribblings/reference/sandbox.scrbl +++ b/collects/scribblings/reference/sandbox.scrbl @@ -612,3 +612,7 @@ A macro version of @scheme[call-with-limits].} A predicate and accessor for exceptions that are raised by @scheme[call-with-limits]. The @scheme[resource] field holds a symbol, either @scheme['time] or @scheme['memory].} + +@; ---------------------------------------------------------------------- + +@close-eval[box-eval] diff --git a/collects/scribblings/reference/serialization.scrbl b/collects/scribblings/reference/serialization.scrbl index a47ffb4712..1c4e39afaf 100644 --- a/collects/scribblings/reference/serialization.scrbl +++ b/collects/scribblings/reference/serialization.scrbl @@ -491,3 +491,7 @@ This directory path is used as a last resort when @scheme[deserialize-id] indicates a module that was loaded through a relative path with respect to the top level. Usually, it should be @scheme[(or (current-load-relative-directory) (current-directory))].} + +@; ---------------------------------------------------------------------- + +@close-eval[ser-eval] diff --git a/collects/scribblings/reference/shared.scrbl b/collects/scribblings/reference/shared.scrbl index 62d7915314..dbb40059ca 100644 --- a/collects/scribblings/reference/shared.scrbl +++ b/collects/scribblings/reference/shared.scrbl @@ -122,3 +122,7 @@ data cycles (but only with cycles that can be created via mutation). b) ]} + +@; ---------------------------------------------------------------------- + +@close-eval[shared-eval] diff --git a/collects/scribblings/reference/strings.scrbl b/collects/scribblings/reference/strings.scrbl index 6949c9e748..3316f152e7 100644 --- a/collects/scribblings/reference/strings.scrbl +++ b/collects/scribblings/reference/strings.scrbl @@ -384,3 +384,5 @@ one between @scheme[list] and @scheme[list*]. (string-append* (cdr (append* (map (lambda (x) (list ", " x)) '("Alpha" "Beta" "Gamma"))))) ]} + +@close-eval[string-eval] diff --git a/collects/scribblings/reference/struct.scrbl b/collects/scribblings/reference/struct.scrbl index d2ffedf435..dc77e07b17 100644 --- a/collects/scribblings/reference/struct.scrbl +++ b/collects/scribblings/reference/struct.scrbl @@ -610,3 +610,7 @@ by @scheme[make-struct-info]. This @tech{structure type descriptor} is mostly useful for creating structure subtypes. The structure type includes a guard that checks an instance's first field in the same way as @scheme[make-struct-info].} + +@; ---------------------------------------------------------------------- + +@close-eval[struct-eval] diff --git a/collects/scribblings/reference/stx-trans.scrbl b/collects/scribblings/reference/stx-trans.scrbl index f00d22754b..0c0dd8130c 100644 --- a/collects/scribblings/reference/stx-trans.scrbl +++ b/collects/scribblings/reference/stx-trans.scrbl @@ -720,3 +720,7 @@ Like @scheme[syntax-local-certifier], but to certify @tech{syntax objects} that correspond to @scheme[provide] sub-forms, so that @scheme[expand-export] can deconstruct the @tech{syntax object} as necessary to expand it.} + +@; ---------------------------------------------------------------------- + +@close-eval[stx-eval] diff --git a/collects/scribblings/scribble/eval.scrbl b/collects/scribblings/scribble/eval.scrbl index e6b4df83a6..31231965a5 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)]{