Evaluation
Evaluation is the process by which Lisp determines
the value of an expression; Lisp uses the following recursive algorithm:
- If the expression to be evaluated is a constant, such as a number,
#t or #f, the value is the expression itself.
- If the expression is (QUOTE x), which we abbreviate as 'x,
the value is x.
- If the expression is a symbol, the value is the
binding
of the symbol (or an error if the symbol is unbound).
- Otherwise, the expression must be a list that represents a
function call or special form:
- Evaluate each element of the function call, in left-to-right
order.
- Call the function with the values of the arguments.
- The value is the value returned by the function.
Special forms such as if, quote,
define, and set! do not evaluate all their arguments.
Note that evaluation ``calls itself'' recursively to evaluate arguments.
Contents   
Page-10   
Prev   
Next   
Page+10   
Index