Closed lispegistus closed 11 years ago
I don't understand why such an opportunity is needed for a wide range of applications. I think it's pretty is a rare need.
Maybe something like:
(defclass proxy-renderer ()
((target :initarg target :accessor proxy-renderer-tardet)))
(defmethod restas:render-object ((proxy proxy-renderer) obj)
(render-object (proxy-renderer-tardet proxy) obj))
(defparamater *mutable-renderer*
(make-instance 'proxy-renderer :target #'my-fist-render-method))
(restas:mount-module -my-module- (#:mymodule)
(:render-method *mutable-renderer*))
(setf (proxy-renderer-tardet *mutable-renderer*)
#'my-second-render-method)
suit you?
Now I have another problem. The render-method keyword argument to restas:start doesn't seem to work. I get a simple-error: "Unknown as render (TITLE Hello BODY World) via NIL".
(gethash :render-method (gethash (find-package '#:blogdemo) restas::*pkgmodules-traits*))
returns nil
Oh, I fixed this a long time, but forgot make commit. Fixed.
I need to be able to set the render method of a module from within the module, doing it in define-module or mount-module would be inconvenient. After 10 minutes with the source, I came up with this hack:
Is there a better way? I could implement something better and send a pull request, but I don't quite understand the implementation of the new module system yet.