summaryrefslogtreecommitdiff
path: root/def.lisp
diff options
context:
space:
mode:
authorcolin <colin@cicadas.surf>2024-06-18 08:47:42 -0700
committercolin <colin@cicadas.surf>2024-06-18 08:47:42 -0700
commit2111f61524e5fbdf843950de60740f3a15b5274f (patch)
tree448a1feea5e3e237ba4e39ff63b30ab5a0e6c3e7 /def.lisp
parent06f8c9c96a1d13451276ded4e091175eafd5b4e9 (diff)
Fix: docstring in def:fast; update readme
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)))))