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, which now must be a list, is the name of a function, or is a LAMBDA expression, recursively evaluate the remaining elements of the list as arguments, and then apply the function to the evaluated arguments, and return the result. (But give an error if the wrong number of args were given).
- 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 MACROEXPAND to the form, and then evaluate the result of that and return whatever results from this second evaluation.
- OTHERWISE issue an error saying that the first element of FORM was not recognized as a function.