eval


(eval  string)

This function evaluates a Lisp expression, and returns the result of evaluation.

Arguments

string  any string containing a valid Lisp expression

Return

the result of last evaluated expression part

Example

(eval (read "(setq xxx 123)"))
123  is the last-evaluated expression from (setq xxx 123)

Remarks

often used with "dynamic" Lisp expressions :
(eval (read string))
where 'string' is an expression constructed by code or read from a file;

see (read) function;
(read) only reads 1 single Lisp expression, multiple expressions need to be grouped into "(progn ....)" bracket



©  Bricsys NV. All rights reserved.