diff options
Diffstat (limited to 'tail-recursion.lisp')
-rw-r--r-- | tail-recursion.lisp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tail-recursion.lisp b/tail-recursion.lisp index cca24a7..40e94c9 100644 --- a/tail-recursion.lisp +++ b/tail-recursion.lisp @@ -204,6 +204,10 @@ ;;; bailing out dynamically to a dispatching loop which calls the next ;;; function in the chain. ;;; +;;; NOTE: The Wikipedia describes a trampoline based approach for tail +;;; recursion, which is probably more or less equivalent to what is going on +;;; here. The *tail-escape* can be identified as the trampoline function. +;;; ;;; It would be inconvenient to have to use TAIL-CALL everywhere in a tail ;;; block. We can hide the tail call mechanism behind lexical functions, so ;;; that a tail block can use ordinary function call syntax to call its @@ -254,8 +258,7 @@ (docstring) (decls)) (when (stringp (first body)) - (setf docstring (list (first body))) - (pop body)) + (setf docstring (list (pop body)))) (loop for f = (first body) while (and (consp f) (case (first f) |