From 82b803603f519bcd91eb4a2fbc9bb5c2bfa6e168 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sat, 9 Jan 2021 21:45:15 +0100 Subject: Added render functions, Splitting into multiple files --- helper.lisp | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 helper.lisp (limited to 'helper.lisp') 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))))) -- cgit