Evaluation

Evaluation is the process by which Lisp determines the value of an expression. Expressions are evaluated using the following recursive algorithm:

  1. If the expression to be evaluated is a number, T, or NIL, its value is the expression itself.

  2. If the expression is (QUOTE x), its value is x.

  3. If the expression is a symbol, its value is the value of the symbol (the symbol's binding).

  4. Otherwise, the expression must be a list that represents a function call:
    1. Evaluate each argument of the function call, in left-to-right order.

    2. Call the function with the resulting values of the arguments.

    3. The value returned by the function is the value of the expression.

Contents    Page-10    Prev    Next    Page+10    Index