diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/routes.lisp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/routes.lisp b/src/routes.lisp index 8303b14..272d579 100644 --- a/src/routes.lisp +++ b/src/routes.lisp @@ -79,15 +79,13 @@ ((not slot) (error "")) ((symbolp slot) - `(,slot (assoc-value ,alist ',(symbol-name slot) - :test #'string-equal))) + `((,slot (assoc-value ,alist ',(symbol-name slot) + :test #'string-equal)))) ((listp slot) (destructuring-bind (var &key init-form name suppliedp) slot - `(,var (or (assoc-value ,alist ',name :test #'equal) - ,(if suppliedp - `(progn (setf ,suppliedp t) ,init-form) - init-form))))) + `(,@(if suppliedp `((,suppliedp t)) '()) + (,var (or (assoc-value ,alist ',name :test #'equal) ,init-form))))) (t (error "")))) @@ -100,9 +98,8 @@ ((listp slot) (destructuring-bind (var &optional init-form suppliedp) slot - `((,var (or ,value ,(if suppliedp - `(progn (setf ,suppliedp t) ,init-form) - init-form)))))) + `(,@(if suppliedp `((,suppliedp t)) '()) + (,var (or ,value ,init-form))))) (t (error "")))) @@ -158,8 +155,8 @@ route handles different methods." (let (,@(append (mapcar (rcurry #'path-binding path-alist) (remove-if-not #'symbolp path)) - (mapcar (rcurry #'query-binding query-alist) - query) + (mappend (rcurry #'query-binding query-alist) + query) (fragment-binding fragment fragment-value) (if headers `((,headers ,headers-value)) '()))) ,@body)))))) |