[Bese-devel] EVAL: variable SELF has no value
Marco Baringer
mb at bese.it
Tue May 17 08:44:52 UTC 2005
Pascal J.Bourguignon <pjb at informatimago.com> writes:
> Do I do something wrong or should I just avoid these macros?
i think you're misunderstanding the purpose of CALL and ANSWER.
ANSWER and CALL are component "control flow" operators (if that
terminologoy makes any sense), they allow you to control how we get
from one component to the next. as such they only make sense in the
context of code which controls the passage between components, aka
actions and entry-points.
> (defmethod render-on ((res response) (compo user-admin))
> (call 'not-implemented-yet
> :message (_ "Administration des utilisateurs")))
what this is saying is: when _rendering_ the user-admin object compo
you should first pass control to a not-implemented-yet, when that
_answers_ then the render-on call should return.
This doesn't make any sense (not to me atleast). maybe what you want
to say is: "use not-implemented-yet's render-on method when attempting
to render a user-admin component." this isn't hard to do, but it's
written differently:
(defmethod render-on ((res response) (compo user-admin))
(render-on res (make-instance 'not-implemented-yet ...)))
The other option is to add a rule which says "everytime someone tries
to call a user-admin component we sholud actually jump to a
not-implemented-yet component":
(defmethod/cc call-component ((from standard-component)
(to user-admin))
(let/cc k
(setf (place (component.place from))
(make-instance 'not-implemented-yet
:continuation k
:place (component.place from)
:parent (component.parent from)))))
of course, this doesn't stop anyone from doing (make-instance
'user-admin).
hope this helps.
--
-Marco
Ring the bells that still can ring.
Forget the perfect offering.
There is a crack in everything.
That's how the light gets in.
-Leonard Cohen
More information about the bese-devel
mailing list