Permalink
Browse files

changed Clack.Util.Route:link-to to return two values. New second val…

…ue is the rest params, was not used.
  • Loading branch information...
1 parent d4138bf commit 22ca52c5722dd59b9ab01a4fdb029615233310fe @fukamachi committed Jun 10, 2011
Showing with 12 additions and 8 deletions.
  1. +12 −8 src/util/route.lisp
View
@@ -136,12 +136,15 @@ Example:
'(:name \"fukamachi\"))
;=> \"/hello/fukamachi\"
"
- (apply #'format nil (format-string this)
- (loop for key in (param-keys this)
- if (eq key :splat)
- collect (pop (getf params key))
- else
- collect (getf params key))))
+ (values
+ (apply #'format nil (format-string this)
+ (loop for key in (param-keys this)
+ if (eq key :splat)
+ collect (pop (getf params key))
+ else
+ collect (getf params key)
+ and do (remf params key)))
+ params))
@export
(defmethod link-to ((this <regex-url-rule>) params)
@@ -152,8 +155,9 @@ Example:
'(:name \"fukamachi\"))
;=> \"/hello/fukamachi\"
"
- (apply #'format nil (format-string this)
- (getf params :captures)))
+ (values (apply #'format nil (format-string this)
+ (getf params :captures))
+ (and (remf params :captures) params)))
(doc:start)

0 comments on commit 22ca52c

Please sign in to comment.