eval ( str effect -- )
Factor handbook » The implementation » The parser » Evaluating strings at run time

Prev:eval(
Next:Evaluating strings with a different vocabulary search path


Vocabulary
eval

Inputs
stra string
effectan effect


Outputs
None

Word description
Parses Factor source code from a string, and calls the resulting quotation, which must have the given stack effect.

Notes
The code string is parsed and called in a new dynamic scope with an initial vocabulary search path consisting of just the syntax vocabulary. The evaluated code can use Syntax to control word lookup to alter the search path.

Errors
Throws an error if the input is malformed, or if the evaluation itself throws an error.

Definition