From e9ccc51a0842de01c47a5b1a70f1bbf131eee21e Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Sat, 12 Apr 2025 12:56:56 -0700 Subject: [PATCH] add note that codex is used for documentation. --- README.txt | 10 ++++++++++ kutils.asd | 1 - kutils.lisp | 8 +++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/README.txt b/README.txt index c06dfeb..143e5aa 100644 --- a/README.txt +++ b/README.txt @@ -53,3 +53,13 @@ Miscellanea * mkkw * zip * defclass! + +Documentation +============= + +Documentation is generated with codex [1]: + + CL-USER> (ql:quickload :codex) ;; if not installed + (:CODEX) + CL-USER> (codex:document :kutils) + NIL diff --git a/kutils.asd b/kutils.asd index 5394493..52e0b6d 100644 --- a/kutils.asd +++ b/kutils.asd @@ -11,4 +11,3 @@ (:file "kutils") (:file "kutils-hash-tables") (:file "macros"))) - diff --git a/kutils.lisp b/kutils.lisp index c36f77a..89b8d19 100644 --- a/kutils.lisp +++ b/kutils.lisp @@ -105,7 +105,7 @@ vector. Otherwise, attempt to map it into a vector." ((atom arg) (let ((v (new-vector))) (vector-push-extend arg v) - v)) + v)) (t (mapv #'identity arg)))) (defun extend-vector (v) @@ -175,3 +175,9 @@ those that do not satisfy @c(pred)." ((listp seq) (partition-list pred seq)) ((vectorp seq) (partition-vector pred seq)) (t nil))) + +(defun in-range (number low high) + "Returns T if LOW >= NUMBER <= HIGH." + (and + (<= number high) + (>= number low)))