From 2111f61524e5fbdf843950de60740f3a15b5274f Mon Sep 17 00:00:00 2001 From: colin Date: Tue, 18 Jun 2024 08:47:42 -0700 Subject: Fix: docstring in def:fast; update readme --- def.lisp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'def.lisp') 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))))) -- cgit v1.2.3