TinyMUX

Sandbox()

Functions

Description

FUNCTION: sandbox(<function-list>, <expression>)

Evaluates the given expression with a restricted function set. Only the functions named in the function list are allowed during evaluation; calls to any other function will fail.

This is useful for safely evaluating user-provided expressions in a controlled environment.

Examples

> say sandbox(add mul, add(1,mul(2,3)))

You say, “7”

eval()