From: Roman M. <rom...@gm...> - 2011-02-14 18:43:38
|
Hello, I want to debug the code which is generated and compiled during the program execution. While there is a workaround (I can dump the code into a file and load it on the fly), I would like to ask for a more elegant solution (if any). The next very simplified code demonstrates the real-life problem: (declaim (optimize (debug 3) (speed 0) (safety 3))) (defun generate-lambda (x) `(lambda () (let ((y ,(+ x 7)) (z ,(* x x))) (break) (print y) (print z)))) (defun test () (let ((lm (generate-lambda 8))) (funcall (compile nil lm)))) After this code is compiled and loaded, I evaluate (test) and SLIME shows that there is no information about the locals in the generated lambda: Backtrace: 0: (BREAK "break") 1: ((LAMBDA ())) [No Locals] 2: (TEST) Locals: LM = (LAMBDA () ..) 3: (SB-INT:SIMPLE-EVAL-IN-LEXENV (TEST) #<NULL-LEXENV>) 4: ((LAMBDA ())) Is there any way to make these local variables visible? Thank you, Roman |