summaryrefslogtreecommitdiffstats
path: root/src/common.lisp
blob: 2c56184490f2f944a6e602ec4609635852041659 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
(defun get-file-lines (name)
  (uiop:read-file-lines name))

(defun partial (func &rest args1)
  (lambda (&rest args2)
    (apply func (append args1 args2))))

(defun compose (a b)
  (lambda (&rest args)
    (funcall a (apply b args))))

(defun filter (func l)
  (loop :for i :in l :when (funcall func i) :collect i))

(defun trim (input)
  (string-trim '(#\Space #\Newline #\Backspace #\Tab
                 #\Linefeed #\Page #\Return #\Rubout) input))