[slime-devel] Re: SBCL restart-frame
jsnell at iki.fi
Tue Jan 17 18:56:56 UTC 2006
<jcm at FreeBSD-uk.eu.org> wrote:
> On Sat, Jan 14, 2006 at 11:11:18PM +0100, Mészáros Levente wrote:
>: I am relatively new to SBCL and SLIME, so maybe I'm wrong about this. I
>: did not find restart-frame support for SBCL, so I did this patch and it
>: seems to work for me.
> 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 ()
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.
More information about the slime-devel