{"size": 2852, "ext": "scrbl", "max_stars_repo_path": "share/pkgs/compatibility-doc/mzlib/scribblings/sandbox.scrbl", "max_stars_repo_name": "takikawa/racket-ppa", "max_stars_repo_stars_event_min_datetime": "2018-07-29T04:13:52.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-14T16:11:17.000Z", "max_issues_repo_path": "compatibility-doc/mzlib/scribblings/sandbox.scrbl", "max_issues_repo_name": "NoahStoryM/compatibility", "max_issues_repo_issues_event_min_datetime": "2017-08-25T20:26:37.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T17:48:40.000Z", "max_forks_repo_path": "compatibility-doc/mzlib/scribblings/sandbox.scrbl", "max_forks_repo_name": "NoahStoryM/compatibility", "max_forks_repo_forks_event_min_datetime": "2015-03-09T12:20:01.000Z", "max_forks_repo_forks_event_max_datetime": "2021-10-09T05:02:56.000Z"}
{"max_stars_count": 10, "max_issues_count": 15, "max_forks_count": 8, "avg_line_length": 33.5529411765, "max_line_length": 99, "alphanum_fraction": 0.6276297335}
#lang scribble/doc
@(require "common.rkt"
          (for-label mzlib/sandbox
                     (only-in racket/sandbox make-module-evaluator)))

@(begin
   (define-syntax-rule (bind id)
     (begin
       (require (for-label racket/sandbox))
       (define id (racket make-evaluator))))
   (bind racket-make-evaluator))

@mzlib[#:mode title sandbox]

@deprecated[@racketmodname[racket/sandbox]]{}

The @racketmodname[mzlib/sandbox] library mostly re-exports
@racketmodname[racket/sandbox], but it provides a slightly different
@racket[make-evaluator] function.

The library re-exports the following bindings:

@racketblock[
sandbox-init-hook
sandbox-reader
sandbox-input
sandbox-output
sandbox-error-output
sandbox-propagate-breaks
sandbox-coverage-enabled
sandbox-namespace-specs
sandbox-override-collection-paths
sandbox-security-guard
sandbox-path-permissions
sandbox-network-guard
sandbox-make-inspector
sandbox-eval-limits
kill-evaluator
break-evaluator
set-eval-limits
put-input
get-output
get-error-output
get-uncovered-expressions
call-with-limits
with-limits
exn:fail:resource?
exn:fail:resource-resource
]

@defproc*[([(make-evaluator [language (or/c module-path? 
                                            (one-of/c 'r5rs 'beginner 'beginner-abbr 
                                                      'intermediate 'intermediate-lambda 'advanced)
                                            (list/c (one-of/c 'special) symbol?)
                                            (list/c (one-of/c 'special) symbol?)
                                            (cons/c (one-of/c 'begin) list?))]
                            [requires (or/c (cons/c 'begin list?)
                                            (listof (or/c module-path? path?)))]
                            [input-program any/c] ...)
            (any/c . -> . any)]
           [(make-evaluator [module-decl (or/c syntax? pair?)])
            (any/c . -> . any)])]{

Like @racket-make-evaluator or @racket[make-module-evaluator], but
with several differences:

@itemize[

 @item{The @racket[language] argument can be one of a fixed set of
       symbols: @racket['r5rs], etc. They are converted by adding a
       @racket[(list 'special ....)] wrapper.}

 @item{If @racket[requires] starts with @racket['begin], then each
       element in the remainder of the list is effectively evaluated
       as a prefix to the program. Otherwise, it corresponds to the
       @racket[#:requires] argument of @|racket-make-evaluator|.}

 @item{For each of @racket[language] and @racket[requires] that starts
       with @racket['begin], the expressions are inspected to find
       top-level @racket[require] forms (using symbolic equality to
       detect @racket[require]), and the @racket[require]d modules are
       added to the @racket[#:allow] list for @|racket-make-evaluator|.}

]}
