summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tail-recursion.lisp7
1 files changed, 6 insertions, 1 deletions
diff --git a/tail-recursion.lisp b/tail-recursion.lisp
index 7940113..635982e 100644
--- a/tail-recursion.lisp
+++ b/tail-recursion.lisp
@@ -251,8 +251,12 @@
(defmacro deftail (name lambda-list &body body)
(let ((escape (gensym "ESCAPE-"))
- (other-tails)
+ (other-tails `(,name))
+ (docstring)
(decls))
+ (when (stringp (first body))
+ (setf docstring (list (first body)))
+ (pop body))
(loop for f = (first body)
while (and (consp f)
(case (first f)
@@ -261,6 +265,7 @@
(declare (setf decls (append decls (rest f))) t)))
do (pop body))
`(defun ,name (,@lambda-list &aux (,escape *tail-escape*))
+ ,@docstring
,@decls
(flet (,@(loop for other in other-tails
collecting `(,other (&rest args)