From 2a5ac4b592fbb537882ddd7176f9d9e6240fa3be Mon Sep 17 00:00:00 2001 From: not manx Date: Thu, 25 Jun 2020 10:01:30 +0000 Subject: [PATCH] Use &aux for (conf) --- .gitignore | 3 ++- src/db.lisp | 2 +- src/utils.lisp | 13 ++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index d0a1ccb..3cb8f7a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ src/config.lisp -\#*# \ No newline at end of file +\#*# +backups/ diff --git a/src/db.lisp b/src/db.lisp index bd2ee05..b55476b 100644 --- a/src/db.lisp +++ b/src/db.lisp @@ -13,7 +13,7 @@ (defparameter *flags-txt* nil) (defparameter conn nil) -(defvar get-posts-sql "SELECT posts.post_nr, flags.flag from flags left join postflags on (postflags.flag = flags.id) left join posts on (postflags.post_nr = posts.id) where posts.post_nr in (~{'~a'~^,~}) and posts.board = '~a';") +(defparameter get-posts-sql "SELECT posts.post_nr, flags.flag from flags left join postflags on (postflags.flag = flags.id) left join posts on (postflags.post_nr = posts.id) where posts.post_nr in (~{'~a'~^,~}) and posts.board = '~a';") (defmacro dbfun (name &rest body) `(defun ,name ,(car body) diff --git a/src/utils.lisp b/src/utils.lisp index ea76991..3420fe3 100644 --- a/src/utils.lisp +++ b/src/utils.lisp @@ -6,11 +6,10 @@ (defvar empty-flag '("empty, or there were errors. Re-set your flags.")) -(defun conf (thing) - (let ((item (nth 1 (assoc thing config)))) - (if (null item) - (error "no such config item" thing) - item))) +(defun conf (thing &aux (item (cadr (assoc thing config)))) + (if (null item) + (error "no such config item" thing) + item)) (defun set-boards () (setf *boards* (make-hash-table :test 'equal)) @@ -56,5 +55,5 @@ (boardp board))) ;; Content types -(defvar @json "application/json") -(defvar @plain "text/plain") +(defparameter @json "application/json") +(defparameter @plain "text/plain")