From: Nikodemus S. <nik...@ra...> - 2011-02-14 19:02:28
|
;;; 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 |