(let ((counter 0))
(defun fresh-k-id (method-name form-name)
(princ-to-string (incf counter))))
Macro defwethod Defines a wethod that allows the special forms `read-form' and `render' in the body.
(def/rkr/macro %read-form-macro (name &key template &rest args)
"Fancy macro to output a form, and then return to the current continuation of the wethod when user submits the form."
(let ((k (gensym "k"))
(k-id (gensym "k-id"))
;; This form depends on the fact that form-name is not a keyword.
(form-name (car args))
(form-args (cdr args))
#+(or)(form (gensym "form"))
(let ((,k-id (fresh-k-id ',name ,form-name)))
;; ,(when template
;; ;; how expensive is it to create call/cc closures?
;; ;; TODO memoizing actually must occur at runtime.
;; `(save-read-form-template-fn ,k-id
;; ;; note this closure would capture variables.
;; (fn (this-form-html-string)
;; (symbol-macrolet ((this-form (html (:noescape this-form-html-string))))
;; (html ,template)))))
(symbol-macrolet ((this-form (html (:noescape this-form-html-string))))
(return-from ,name t)))))