我希望能够处理使用动态数量的表单字段的表单
例如
(form :action "/theaction"
:method "post"
(input :type "text" :name "firstinput") (:br)
(dotimes (i n)
(:input :type "text" :name (FORMAT nil "INPUT~a" i)))
(:input :type "submit" :value "submit" :name "submit"))
我如何将处理程序定义&rest
为不被接受并且不允许我访问显然需要进一步处理的变量名。
(define-easy-handler (theaction :uri "/theaction") (&special-rest all-params)
(log-message* :INFO "~a" all-params))
-> "(("firstinput" . "value") ("INPUT0" . "value") ("INPUT1" . "value") ...)"
一种可能性是预先定义所有变量,例如最多为 100,但这看起来相当麻烦且不直观。