Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 236
Steve Quezadas Avatar asked Oct 08 '11 16:10

Steve Quezadas


1 Answers

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.

like image 192
danlei Avatar answered Sep 27 '22 22:09

danlei