[Bese-devel] Strange method combination

Marco Baringer mb at bese.it
Mon May 30 15:55:00 UTC 2005


Pupeno <pupeno at pupeno.com> writes:

> Hello,
> I was working on a web site refactoring the presentations example when I 
> noticed a very weird behaviour. When edit-from-listing was called, the 
> database (using cl-sql) got updated but the listing showed the old record, so 
> I started researching and I've found a very strange problem: 
> edit-from-listing :after gets called before edit-from-listing finishes. I've 
> added some very verbose debuging output and this is what I get:

the problem si that edit-from-listing isn't a regular method but an
"action." here's the gory details:

(defaction foo ((c component))
  (pre-call)
  (call 'some-component)
  (post-call))

(defmethod foo :after ((c component))
  (do-stuff))

now if we call (foo c) the first thing that happens is the PRE-CALL is
called and this makes sense. then however we have (call
'some-component), at this point the execution of foo stops, the
contiuation (which amounts to just a call to POST-CALL) is stored in
the new some-component object and the method foo _returns_. Method
combination being what it is this causes foo :after to run and
do-stuff to get called. sholud the SOME-COMPONENT return at a later
date the form (post-call) will get executed but, since foo isn't being
called directly, do-stuff will not.

this behaviour can be fixed with a custom method-combination, until
then you're screwed.

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