aboutsummaryrefslogtreecommitdiff
path: root/src/util.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-05-31 11:39:17 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-05-31 14:17:45 -0700
commitea65968c79bf0709664081e4c116dee0d9c536ab (patch)
treed5020ad301052db98d873584565352089cbcbe7a /src/util.lisp
parent47aa65619025242b26cf3473efe25f88c24ae323 (diff)
downloadconsfigurator-ea65968c79bf0709664081e4c116dee0d9c536ab.tar.gz
add & use WORDS, UNWORDS
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/util.lisp')
-rw-r--r--src/util.lisp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/util.lisp b/src/util.lisp
index 3260de0..9d50a17 100644
--- a/src/util.lisp
+++ b/src/util.lisp
@@ -29,6 +29,12 @@
(defun unlines (lines)
(format nil "~{~A~%~}" lines))
+(defun words (text)
+ (remove "" (split-string text) :test #'string=))
+
+(defun unwords (words)
+ (format nil "~{~A~^ ~}" words))
+
(defmacro symbol-named (name symbol)
`(and (symbolp ,symbol)
(string= (symbol-name ',name) (symbol-name ,symbol))))