diff options
-rw-r--r-- | lazybones.lisp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lazybones.lisp b/lazybones.lisp index 3345afe..148cd05 100644 --- a/lazybones.lisp +++ b/lazybones.lisp @@ -238,9 +238,9 @@ ENDPOINT's handler function." (defun parse-route-string-template (template) "Routes are of the form -/foo/bar/<<variable>>/blah +/foo/bar/:variable:/blah -/foo/bar/<<var parse-integer>>/blah +/foo/bar/:var parse-integer:/blah On success returns things like: @@ -267,20 +267,20 @@ Returns NIL on failure" collect (string-downcase field))))) (defun parse-route-variable-string (string) - "A route variable string looks like <<foo>> or <<foo bar>> + "A route variable string looks like :foo: or :foo bar: In the case of a successful parse, a list of one or two symbols is returned. These symbosl are created using read-from-string, which allows for these symbols' packages to be specified if desired. Returns NIL on failure." - (when (and (a:starts-with-subseq "<<" string) - (a:ends-with-subseq ">>" string)) + (when (and (a:starts-with-subseq ":" string) + (a:ends-with-subseq ":" string)) (destructuring-bind (var-name . decoder?) (re:split " +" (string-trim " " - (subseq string 2 (- (length string) 2)))) + (subseq string 1 (- (length string) 1)))) (if decoder? (list (string-upcase var-name) (read-from-string (first decoder?))) (list (string-upcase var-name)))))) |