next up previous
Contents Next: evenpoddp (PREDICATES) Up: Appendix: Selected Lisp Previous: eql (PREDICATE)

eval (FUNCTION)

Format: (eval <exp> )

Required arguments: 1

<exp> : any Lisp expression.

eval provides direct access to the Lisp expression evaluator. It causes the evaluation of whatever <exp> returns. Thus, if <exp> is an evaluable Lisp expression that returns an evaluable Lisp expression, then eval returns the value of evaluating this second expression.

Examples:

> (eval '(+ 1 2))
3

> (eval (cons '+ '(1 2)))
3

> (eval 3)
3

> (eval (+ 3 4))
7

> (eval (cons 'a '(s d f)))
Error: The function A is undefined.



© Colin Allen & Maneesh Dhagat
March 2007