Yes, I see it now.

Thanks a lot for the help!

Roman

2011/2/14 Nikodemus Siivola <nikodemus@random-state.net>
;;; In your example the constants get optimized despite
;;; any debug setting.
(defun generate-lambda ()
 `(lambda (x)
    (let ((y (+ x 7))
          (z (* x x)))
      (break)
      (print y)
      (print z))))

;;; The DECLAIM is file local, and doesn't affect COMPILE.
(defun test (&optional policy)
 (let ((lm (generate-lambda)))
   (funcall (funcall (compile nil
                              `(lambda ()
                                 (declare (optimize ,@policy))
                                 ,lm)))
            8)))

(test '(debug 3))

...gives:

break
  [Condition of type SIMPLE-CONDITION]

Restarts:
 0: [CONTINUE]         Return from BREAK.
 1: [RETRY]            Retry SLIME interactive evaluation request.
 2: [*ABORT]           Return to SLIME's top level.
 3: [TERMINATE-THREAD] Terminate this thread (#<THREAD "worker"
RUNNING {100312CAA1}>)

Backtrace:
 0: (BREAK "break")
 1: ((LAMBDA (X)) 8)
     Locals:
       X = 8
       Y = 15
       Z = 64

Cheers,

 -- Nikodemus