开发者

Inspecting a variable in the lisp SLIME debugger

I am trying to inspect the value of a variable 开发者_如何学运维at a determined breakpoint. Here is my simplified code:

(defun foo ()
  (maplist (lambda (var)
        (break)
        var)
      '(a b c)))

slime goes into debugger mode at this point. So I try to eval by pressing either the ":" or the "e" key and then I type "(car var)", but slime keeps on saying:

The variable VAR is unbound. [Condition of type UNBOUND-VARIABLE]

I am confused as to why it's saying this since "(break)" is within the anonymous function and within the scope of "var".


That works for me under CCL and CLisp. I think whether this works depends on your implementation, and maybe your OPTIMIZE settings. You could try:

(declaim (optimize (debug 3)))

You'll have to recompile your code afterwards for it to take effect.

Or maybe, if your implementation supports interpretation, you could try that, since some implementations provide better debugging possibilities for interpreted than for compiled code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜