Next Previous Contents

32. eval

Synopsis

Interpret a string as S-lang code

Usage

eval (String_Type expression)

Description

The eval function parses a string as S-Lang code and executes the result. This is a useful function in many contexts such as dynamically generating function definitions where there is no way to generate them otherwise.

Example

    if (0 == is_defined ("my_function"))
      eval ("define my_function () { message (\"my_function\"); }");
See Also

is_defined, autoload, evalfile


Next Previous Contents