[Bese-devel] task component related questions

Marco Baringer mb at bese.it
Fri Sep 23 11:45:31 UTC 2005


basically task components aren't meant to be rendered. let's say you
have a collection of tasks all of which require login, here's how
you'd go about it:

(defcomponent login-task-mixin ()
  ())

(defmethod start :before ((l login-task-mixin))
  (call 'login-component))

(defcomponent my-other-task (task-component login-task-mixin)
  ())

(defmethod start ((task my-other-task))
  (do-something-assuming-that-we-are-already-logged-in))

Aleksandar Bakic <a_bakic at yahoo.com> writes:

> (defmethod render-on :around ((res response) (task task-component))
>   (with-call/cc
>     (start task)) ; how exactly does this work?

the 'problem' is that methods defined via defmethod/cc (as all actions
are) and functions defined via defun/cc _must_ be called within the
dynamic context of a with-call/cc (these funcitons and methods don't
have a corresponding "regular" implementation).

>   (let ((active-component (place (component.place task)))) ; ???
>     (if (eq task active-component) ; ???

basically what does is say: if the component in question is the
original component (no call'ing) then call-next-method, otherwise
render the component in question. this is, more or less, repeating the
work done by call/answer.

>         (call-next-method)
>         (render-on res active-component)))) ; is this a caller?

what do you mean by caller?

> (defmethod render-on ((res response) (task task-component))
>   nil) ; some default behavior, needed for the above method

this is, imho, a sign that something could improved.

-- 
-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