evalstring
evalstring(t_string[s_langMode] ) =>g_value/nil
Description
Reads and evaluates an expression stored in a string.
The resulting value is returned. Notice that evalstring does not allow the outermost set of parentheses to be omitted from the evaluated expression, as in load or in the top level.
Arguments
Value Returned
Examples
The 1+2 infix notation is the same as (plus 1 2).
evalstring("1+2")
=> 3
The following example signals that car is an unbound variable.
evalstring("cons('a '(b c))")
=> (a b c)
car '(1 2 3)
=> 1
evalstring("car '(1 2 3)")
Related Topics
Function and Program Structure
Return to top