[Bese-devel] isolated actions

Drew Crampsie drewc at tech.coop
Wed Apr 5 06:17:58 UTC 2006


Evrim ULU wrote:
> Drew Crampsie wrote:
> 
> 
>>:isolate should be used when you only want an action to fire once,
>>even if the same link is clicked or the page reloaded.
>>
>>For example, if i have an 'charge-credit-card' action, i would not
>>want a reload of the page or a 'back-button, click same link' to
>>charge the card _again_ (well, i wouldn't mind, but the customer might
>>be pissed). :ISOLATE memoizes the action body so that it will only run
>>once, regardless of how many times the same URL is hit.
>>
>>The attached patch is against a slightly older ucw_dev. If it no
>>longer applies cleanly, the replacement code for DEFACTION follows
>>(and RUN-ISOLATED can be removed from standard-component.lisp).
> 
> 
> That's great, there is one point i want to learn. If an action must be
> isolated, do we need the same action as unisolated? It seems they'r
> mutually exclusive. So, instead of hacking defaction, something like
> defisolated-action would work better IMHO. What do you think?

I don't really see the difference (besides another symbol to export). If 
you need an isolated version of an action and a non-isolated, why not 
simply define the former in terms of the latter? ie:

(defaction foo (...)...)

(defaction isolate-foo :isolate (...)
   (foo ...))

Even if we make a new macro, actions still share the same namespace, so 
you'd still need the two defining forms, and since :isolate requires a 
change to standard-component (the hash table to store results), i can't 
see anything wrong with it being part of the standard machinery (and nor 
does marco, who put my :isolate patch in mainline UCW over a year ago).

What problem are you trying to solve that requires the separation of the 
  two defining macros in a way the current code does not?

cheers, drewc




> king regards,
> evrim.
> _______________________________________________
> 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