▼ |  | Unstable: May Change Without Warning

1 | Guidelines for Developing unstable Libraries
2 | Automata: Compiling State Machines
3 | Bytes
4 | Contracts
5 | Converting Values to Strings
6 | Contracts for Macro Subexpressions
7 | Debugging
8 | Definitions
9 | Errors
10 | Filesystem
11 | Find
12 | Flonums
13 | Futures
14 | Functions
15 | Hash Tables
16 | Interface-Oriented Programming for Classes
17 | Lazy Require
18 | Lists
19 | Logging
20 | Mark Parameters
21 | Match
22 | Open place expressions
23 | Parameter Groups
24 | Pretty-Printing
25 | Re-Contracting Identifiers
26 | Sandbox
27 | Sequences
28 | Strings
29 | Structs
30 | Struct Printing
31 | Syntax
32 | Temporal Contracts: Explicit Contract Monitors
33 | GUI Libraries

On this page:

make-log-based-eval

Version: 5.3.1
top ← prev up next →

### 26`` Sandbox

Ryan Culpepper <ryanc@racket-lang.org>

This library is unstable; compatibility will not be maintained. See Unstable: May Change Without Warning for more information.

( require unstable/sandbox )

> > procedure

> > ( make-log-based-eval log-file mode) → ( -> any/c any )

> log-file : path-string?
> mode : ( or/c 'record 'replay)

Creates an evaluator (like make-base-eval) that uses a log file to either record or replay evaluations.

If mode is 'record, the evaluator records every interaction to log-file, replacing log-file if it already exists. The result of each interaction must be serializable.

If mode is 'replay, the evaluator uses the contents of log-file instead of actually performing evaluatings. For each interaction, it compares the term to evaluate against the next interaction recorded in log-file. If the term matches, the stored result is returned; if not, the evaluator raises an error indicating that it is out of sync with log-file.

Use make-log-based-eval to document libraries when the embedded examples rely on external features that may not be present or appropriately configured on all machines.

top ← prev up next →