Use &aux for (conf)

ご主人様
not manx 4 years ago
parent c4e13c4646
commit 2a5ac4b592
Signed by: C-xC-c
GPG Key ID: F52ED472284EF2F4

3
.gitignore vendored

@ -1,2 +1,3 @@
src/config.lisp src/config.lisp
\#*# \#*#
backups/

@ -13,7 +13,7 @@
(defparameter *flags-txt* nil) (defparameter *flags-txt* nil)
(defparameter conn 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) (defmacro dbfun (name &rest body)
`(defun ,name ,(car body) `(defun ,name ,(car body)

@ -6,11 +6,10 @@
(defvar empty-flag '("empty, or there were errors. Re-set your flags.")) (defvar empty-flag '("empty, or there were errors. Re-set your flags."))
(defun conf (thing) (defun conf (thing &aux (item (cadr (assoc thing config))))
(let ((item (nth 1 (assoc thing config)))) (if (null item)
(if (null item) (error "no such config item" thing)
(error "no such config item" thing) item))
item)))
(defun set-boards () (defun set-boards ()
(setf *boards* (make-hash-table :test 'equal)) (setf *boards* (make-hash-table :test 'equal))
@ -56,5 +55,5 @@
(boardp board))) (boardp board)))
;; Content types ;; Content types
(defvar @json "application/json") (defparameter @json "application/json")
(defvar @plain "text/plain") (defparameter @plain "text/plain")

Loading…
Cancel
Save