[slime-devel] Re: SBCL restart-frame

Mészáros Levente melevy at freemail.hu
Fri Jan 20 08:24:26 UTC 2006


> > Is it really this simple?
> 
> Not quite. The restarted function will be run in the wrong dynamic 
> environment. For example:
> 
> (declaim (optimize (debug 2)))
> 
> (defvar *a* 0)
> 
> (defun foo (a)
>   (let ((*a* (1+ *a*)))
>     (/ 2 a)))
> 
> (defun bar ()
>   (print *a*)
>   (foo 0))
> 
> When you call BAR, it'll print 0 and then call FOO, which will signal 
> an error. If we now restart BAR, the dynamic binding for *A* that 
FOO 
> established will still be visibile, and it'll print 1 instead.

On the other hand return from frame is already supported for SBCL in 
SLIME.

And if I got it right the above statement also means that return from 
frame works the same "somewhat bad" way. I mean returning from the 
frame of bar (in the debugger) the value of *a* will return 1 instead of 
0.

Am I right?

levy


________________________________________________________________________
Képkidolgozás már bruttó 25,- Ft-tól! FotoMarket Online Fotóáruház 
- már 5 éve az Ön fotószolgálatában: www.fotomarket.hu





More information about the slime-devel mailing list