diff options
author | Colin Okay <cbeok@protonmail.com> | 2020-06-08 15:18:27 -0500 |
---|---|---|
committer | Colin Okay <cbeok@protonmail.com> | 2020-06-08 15:18:27 -0500 |
commit | b7010dfa6574984a5045aa35f7f540efac77e8db (patch) | |
tree | ce35f819682280936674949c090eaab117f69b3a /lazybones.lisp | |
parent | 0bba9ab974a9c70a744b0d7d5c254d898795ee83 (diff) |
altered syntax of with-handler-preamble
Diffstat (limited to 'lazybones.lisp')
-rw-r--r-- | lazybones.lisp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lazybones.lisp b/lazybones.lisp index b1ffd0e..e7d1e94 100644 --- a/lazybones.lisp +++ b/lazybones.lisp @@ -152,7 +152,8 @@ E.g.: /foo/bar/:goo/zar/:moo would result in (GOO MOO)" (loop :for val :in (split-sequence:split-sequence #\/ path-spec) :when (path-var-p val) :collect (read-from-string (subseq val 1)))) -(defmacro with-handler-preamble (preamble &body route-defs) + +(defmacro with-handler-preamble ((&rest preamble) &body route-defs) "Inserts PREAMBLE form into the beginning of each ROUTE-DEF, which must be a valid DEFROUTE form. @@ -166,9 +167,10 @@ setting up variables, etc. :collect (list* 'lazybones:defroute method path - (cons preamble handler-forms))))) + (append preamble handler-forms))))) `(progn ,@transformed))) + (defmacro defroute (method path &rest body) "Defines a new route handler. |