summaryrefslogtreecommitdiff
path: root/def.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'def.lisp')
-rw-r--r--def.lisp12
1 files changed, 7 insertions, 5 deletions
diff --git a/def.lisp b/def.lisp
index 0142801..c4ab58b 100644
--- a/def.lisp
+++ b/def.lisp
@@ -133,8 +133,10 @@ E.g.
(if other (cons var other) var)
ll))))
:finally (return (values (nreverse ll) types)))
- `(defun ,name ,lambda-list
- (declare ,@type-declarations
- (values ,return-type)
- (optimize (speed 3) (safety 0)))
- ,@body)))
+ (let ((docstring (when (stringp (first body)) (first body))))
+ `(defun ,name ,lambda-list
+ ,@(when docstring (list docstring))
+ (declare ,@type-declarations
+ (values ,return-type)
+ (optimize (speed 3) (safety 0)))
+ ,@(if docstring (rest body) body)))))