[bugfix] Re: [Bese-devel] "Memoized" One time actions.

Drew Crampsie drewc at tech.coop
Sat Feb 5 02:32:30 UTC 2005


the isolate patch contains a bug. if an action returns NIL it will be 
treated as non-isolated.. bad bad drewc.

Here is a fixed patch against 210. For those following along at home, 
the new code is :

(defmethod run-isolated ((comp standard-component) fun &rest args)
   "isolate an action so that repeated calls (ie by reloading the page) 
use a cached value"
   (let ((memo-id
	 (concatenate 'string
		      (ucw::find-session-id *context*)
		      (ucw::find-frame-id *context*)
		      (ucw::find-action-id *context*))))
     (multiple-value-bind (memo memo-present-p) (gethash memo-id 
(component.isolate-hash comp))

       (format t "looking for memo :~A : found ~A" memo-id memo)
       (if  memo-present-p
	   memo
	   (setf (gethash memo-id (component.isolate-hash comp)) (apply fun 
args))))))

note the use of memo-present-p and let that be a lesson to you :). bad 
bad coder.

drewc


-------------- next part --------------
A non-text attachment was scrubbed...
Name: isolate-fixed.diff
Type: text/x-patch
Size: 2879 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/bese-devel/attachments/20050204/a68ff045/attachment.bin>


More information about the bese-devel mailing list