aboutsummaryrefslogtreecommitdiff
path: root/helper.lisp
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2021-01-09 21:45:15 +0100
committerCharles Cabergs <me@cacharle.xyz>2021-01-09 21:45:15 +0100
commit82b803603f519bcd91eb4a2fbc9bb5c2bfa6e168 (patch)
tree0ef60f270812fd1e7ba041773c853bc4497e5a24 /helper.lisp
parentfc9c7130b08ebc7ad4dbd0f16040251089c11f33 (diff)
downloadtemper-82b803603f519bcd91eb4a2fbc9bb5c2bfa6e168.tar.gz
temper-82b803603f519bcd91eb4a2fbc9bb5c2bfa6e168.tar.bz2
temper-82b803603f519bcd91eb4a2fbc9bb5c2bfa6e168.zip
Added render functions, Splitting into multiple files
Diffstat (limited to 'helper.lisp')
-rw-r--r--helper.lisp12
1 files changed, 12 insertions, 0 deletions
diff --git a/helper.lisp b/helper.lisp
new file mode 100644
index 0000000..d2b9d77
--- /dev/null
+++ b/helper.lisp
@@ -0,0 +1,12 @@
+; read a stream into a string
+(defun read-all-stream (stream)
+ (let ((line (read-line stream nil)))
+ (if line (concatenate 'string line '(#\linefeed) (read-all-stream stream)) "")))
+
+
+; convert variable arguments into variable keyword arguments
+(defun rest-keys (&rest args)
+ (if (null args)
+ '()
+ (destructuring-bind (key value &rest args) args
+ (cons (list key value) (apply #'rest-keys args)))))