chickadee » sandbox » safe-eval

safe-eval EXPRESSION #!key ENVIRONMENT FUEL ALLOCATION-LIMITprocedure

Evaluates EXPRESSION in a safe evaluation context. FUEL specifies how much fuel the pre-translation and evaluation has before an exception will be raised. ALLOCATION-LIMIT gives (a rough) estimation over the maximal size of storage that may be allocated during the evalution of EXPRESSION. FUEL and ALLOCATION-LIMIT default to #f, meaning no limit is given.

ENVIRONMENT specifies the evaluation environment that should be used, and defaults to the value of default-safe-environment.

Should an error occur during the execution of EXPRESSION, a composite condition of the original error condition and a condition of the kind sandbox will be signalled.

Note that de-allocation is not tracked, only allocation.