[Bese-devel] unwinding

Marco Baringer mb at bese.it
Tue Sep 27 19:19:39 UTC 2005


Aleksandar Bakic <a_bakic at yahoo.com> writes:

> Hi,
>
> First, here is a solution I like better:
>
> (defaction logout ((c login-mixin))
>   (setf (get-session-value 'user) nil) ; remove login info
>   (setf (ucw::frame.window-component (ucw::context.current-frame *context*))
> 	(make-instance 'main))) ; simply throw away all the components
>
> It works as I wanted. I just need to try it 1000 times and see if it leaks
> memory... What do you think? (I do not count data that I may be stuffing
> somewhere, but just UCW.)

since UCW keeps old frames around this will leak frames, a very
hackity solution is to add this to your logout method [untested]:

(clrhash (ucw::session.frame-table (ucw::context.current-session *context*)))

though at this point you've basically reimplemented delete-session :)

> I looked at arnesi again. What if the following code from handlers.lisp:
>
> ----
> (defk catch-tag-k (catch env k)
>     (tag)
>   (evaluate-progn/cc (body catch) (register env :catch tag k) k))
>
> (defmethod evaluate/cc ((catch catch-form) env k)
>   (evaluate/cc (tag catch) env `(catch-tag-k ,catch ,env ,k)))
>
> (defk throw-tag-k (throw env k)
>     (tag)
>   (evaluate/cc (value throw) env (lookup env :catch tag :error-p t)))
>
> (defmethod evaluate/cc ((throw throw-form) env k)
>   (evaluate/cc (tag throw) env
>                 `(throw-tag-k ,throw ,env ,k)))
> ----
>
> were modified to call register and lookup at run-time and use a dynamic
> environment instead of env? Am I missing something, i.e., is this more complex
> than what it looks?

that would work, though you'd also need changes to the function
calling code (so that the dynamic env was passed to functions). you
could then trivially add special variables (whcih would be cool.

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