aboutsummaryrefslogtreecommitdiff
path: root/helper.lisp
blob: d2b9d77a469163e62724428ea491fb39be5dc4da (plain)
1
2
3
4
5
6
7
8
9
10
11
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)))))