next up previous contents index
Next: Let Calls Up: Local Call Previous: Local Call   Contents   Index


Self-Recursive Calls

self

Local call is used when a function defined by defun calls itself. For example:

(defun fact (n) (if (zerop n) 1 (* n (fact (1- n)))))
This use of local call speeds recursion, but can also complicate debugging, since trace will only show the first call tofact, and not the recursive calls. This is because the recursive calls directly jump to the start of the function, and don't indirect through the symbol-function. Self-recursive local call is inhibited when the :block-compile argument tocompile-file is nil (see section compile-file-block.)



Peter Van Eynde 2001-03-08