[Bese-devel] actions and broswer refresh

Attila Lendvai attila.lendvai at gmail.com
Wed Feb 22 23:12:26 UTC 2006


> of course it is! :) imagine (<ucw:a :action (display-current-time self)
> ...). click on it, now hit 'back', and then click on the link again.
> You'd expect the time to update, right? i would. or a page with a
> meta-refresh that shows the 'current' news items....

i felt something is wrong with my expectations... :) thanks for enlightening me!

> try (defaction foo :isolate ....), which may or may not still work (has
> anybody tried this lately?). If that doesn't work for you, mail me and
> i'll fix up the memoizing code.

that seems to be exactly what i need, but it doesnt seem to work. the
problem is probably with this:

(PROGN
 (IT.BESE.UCW::%DEFACTION INVALIDATE-IMAGE-G6971
                          ((FOO FOO))
                          (LOG.DEBUG "Invalidating image")
                          (SETF (VALIDP (SLOT-VALUE SELF 'IMAGE)) FALSE))
 (IT.BESE.UCW::%DEFACTION INVALIDATE-IMAGE
                          ((FOO FOO))
                          (IT.BESE.UCW::RUN-ISOLATED FOO
                                                     #'INVALIDATE-IMAGE-G6971
                                                     FOO)))

this is the macroexpansion of a defaction :isolate, and the symptom is:

The function T is undefined.

coming from:

  9: (SB-KERNEL:%COERCE-CALLABLE-TO-FUN T)
 10: ((SB-PCL::FAST-METHOD IT.BESE.UCW::RUN-ISOLATED
(IT.BESE.UCW:STANDARD-COMPONENT T)) #<unavailable argument>
#<unavailable argument> #<DWIM-PRESENTATION-TEST::FOO {DF31279}> T
(#<DWIM-PRESENTATION-TEST::FOO {DF31279}>))
 11: ((LAMBDA (IT.BESE.ARNESI::ARGUMENTS))
(#1=#<DWIM-PRESENTATION-TEST::FOO {DF31279}> T #1#))

for my naiive eyes it seems like the arnesi /cc code has some problem
with #'invalidate-image. after walk-form it properly turns into a
(function invalidate-image...) call:

SOURCE = (IT.BESE.UCW::RUN-ISOLATED FOO (FUNCTION INVALIDATE-IMAGE-G6971) FOO)

but when it comes to execution the (function ...) call turns into a T.

but this all is wild theory... unfortunately i couldn't find any
example of :isolate to check.

> the :isolate code ensures the the body of an action is only executed
> once, but still returns the value when the action in invoked again. I
> believe this is the 'correct' behavior. (assuming it still works). Is
> this sufficient for your needs?

sure! and thanks a lot for the clarification!

- attila

(alias 101 on irc &no 'its not lisp code :)



More information about the bese-devel mailing list