From 9690f8332fa5254a4fdfc30028f62156a2866d5e Mon Sep 17 00:00:00 2001 From: Steven Love Date: Thu, 3 Oct 2024 11:11:05 -0700 Subject: [PATCH] fix: docs macro no longer double-printing usage string --- lisp/core.slosh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/core.slosh b/lisp/core.slosh index e541ee49d8..ced271ce16 100644 --- a/lisp/core.slosh +++ b/lisp/core.slosh @@ -289,11 +289,11 @@ Section: core %# (defmacro doc (sym) (let (docs `(get-prop ~sym :doc-string) - has-usage (str-starts-with "Usage:" (str-trim (str docs)))) + has-usage `(str-starts-with (str-trim (str ~docs)) "Usage:")) (do - (if has-usage - `(prn ~docs) - `(prn (str (usage ~sym) "\n\n" ~docs)))))) + `(if ~has-usage + (prn ~docs) + (prn (str (usage ~sym) "\n\n" ~docs)))))) #% Evaluate body a number of times equal to times' numerical value.