[Bese-devel] Convenient control flow

Drew Crampsie drewc at tech.coop
Tue Oct 2 19:20:12 UTC 2007


Replying to myself here ... with a useful addendum.

Drew Crampsie wrote:
> Mariano Montone wrote:
>> Is there any way of intercepting a child answer and act upon that, other
>> than embedding a task?

Now that i think about this some more, the lispy way to do this is
probably an :around method/cc on call-component. ie:

(defcomponent on-answer-component-mixin () ())

(defmethod/cc on-answer ((on-answer-component-mixin) answer)
  "we might actually do something here, but i don't know what"
  nil)

(defmethod/cc call-component :around
    ((from on-answer-component-mixin) to)
  (let ((answer (call-next-method)))
    (on-answer self answer)))


That _should_ work, though i've not tested it. If it doesn't, post here
again and i'll make it work :).

Cheers,

drewc

>> I have experience with Seaside (the smalltalk framework) and they provide an
>> onAnswer: method that I was able to invoke from the parent component (no
>> need to embed any task).
> 
> Usually, I would do this intercept in the action itself, rather than
> specializing a method, something like
> 
> (let ((answer (call 'foo)))
>   (some-action-or-method self answer))
> 
> You could also specialize the answer-component* method, and you may be
> able to achieve what you want, but you're in nose-dragon area there.
> 
>> Hope the question is clear. I'll provide an example if it is not.
> 
> If you can example of what it is you need to do (rather than how you are
> trying to do it), i'll try to tell you how we'd do that in UCW :).
> 
> Cheers,
> 
> drewc
>> Thanks, Mariano
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> bese-devel mailing list
>> bese-devel at common-lisp.net
>> http://common-lisp.net/cgi-bin/mailman/listinfo/bese-devel
> 
> _______________________________________________
> bese-devel mailing list
> bese-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/bese-devel




More information about the bese-devel mailing list