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
November 1999