[Bese-devel] unwinding
Marco Baringer
mb at bese.it
Sun Oct 9 21:10:31 UTC 2005
Aleksandar Bakic <a_bakic at yahoo.com> writes:
>> Aside, is catch/throw related to the component call stack at all? Perhaps I
> need a different kind of catch/throw...
i jsut added catch/throw (but not special variables (yet)) to the
interpreter, however catch/throw is not related to the component call
stack at all.
> I'll answer this one :) (sorry for so many emails). They aren't, but
> since (call 'main) creates a new component, the component call stack
> of the abandoned component should be gc'd anyway.
nope. (call 'main) creates a component and puts the current component
(accessed through the lexical variable ucw:self) in the calling
component slot, so the call stack will not infact be abandoned (as
with the other things this is to ensure that the user can use the
'back' button to return to the previous state).
here's another way you could 'flush' all the data in the current
session without actually eleting the session (which is still think is
what you should do)[1]:
(setf self NIL)
(with-slots (frames object-table)
(context.session *context*)
(let ((current-frame (context.current-frame *context*)))
(clrhash frames)
(setf (gethash (id current-frame) frames) current-frame))
(clrhash object-table))
(call 'main)
[nb: main must a window-component for this to work and some of those
accessors are internal ucw symbols]
if for some reason you delete-session doesn't work (atm i can't
remeber how that conversation endede) we should look into making it
work (or maybe provide a restart-session function). what you're trying
to do seems perfectly reasonable to me, we should make it easier to
do. maybe we need a JUMP macro which would work just like CALL but
it'd clear out the backtracking and all the various component
"stacks"?
--
-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