[hunchentoot-devel] Accessor Function for Form Fields

Tiarnan O'Corrain ocorrain at gmail.com
Tue Apr 24 09:57:12 UTC 2007


Hi--

I had something like:

(defmacro with-parameters (parameters &body body)
	   `(let ,(mapcar (lambda (p)
			    `(,p (hunchentoot:parameter ,(string-downcase (symbol-name p)))))
			  parameters)
	      , at body))

(macroexpand-1 '(with-parameters (id title description)
			  (format t "Id is ~A, title ~A, desc, ~A" id title description)))
(LET ((ID (HUNCHENTOOT:PARAMETER "id"))
      (TITLE (HUNCHENTOOT:PARAMETER "title"))
      (DESCRIPTION (HUNCHENTOOT:PARAMETER "description")))
  (FORMAT T "Id is ~A, title ~A, desc, ~A" ID TITLE DESCRIPTION))

regards

T



More information about the Tbnl-devel mailing list