Evaluation
- If FORM is a constant, return FORM itself.
- If FORM is a non-constant symbol, and this evaluation is taking place within the scope of a lexical binding for it, return the value of the topmost lexical binding for it, and if not in the scope of a lexical binding, return the symbol-value of FORM if any, and if none, issue an unbound variable error.
- IF FORM is not a list, issue an error.
- IF the first element of FORM is the name of a special form, then perform the special evaluation required by that form and return its value.
- IF the first element of FORM is the name of a macro, apply the transformer to the form, and then evaluate the result of that and return whatever results from this.
- IF the value of the first element of FORM, which now must be a list, is a procedure, or is a LAMBDA expression, recursively evaluate the remaining elements of the list as arguments, and then apply the procedure to the evaluated arguments, and return the result. (But give an error if the wrong number of args were given).
- OTHERWISE issue an error saying that the first element of FORM was not recognized as a procedure.