Steve Quezadas
Steve Quezadas

Reputation: 744

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

Upvotes: 7

Views: 1247

Answers (1)

danlei
danlei

Reputation: 14291

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.

Upvotes: 4

Related Questions