Jeffrey Cunningham wrote:
Suppose I want to call 'DEFINE-EASY-HANDLER inside another function and pass the symbol as an argument. I tried stuff like this:
(defun some-function (name) (define-easy-handler ((intern name) :uri (concatenate 'string name ".html") :default-request-type :post) ((formarg :parameter-type :keyword)) (html-generator name formarg)))
define-easy-handler is a macro, which means that (intern name) doesn't get evaluated unless/until the macro sees fit.
Try defining some-function as a macro too:
(defmacro some-function (name) `(define-easy-handler (,(intern name) :uri ,(concatenate 'string name ".html") :default-request-type :post) ((formarg :parameter-type :keyword)) (html-generator ,name formarg)))
Toby