The fix is really trivial - just to add two lines to the evaluator code is enough.
SBCL behaviour after the fix:
* (declare (print "I am going to be evaluated by SBCL"))
debugger invoked on a SIMPLE-ERROR in thread #<THREAD "initial thread" RUNNING {A9EB801}>:
Declarations are not allowed here: (DECLARE (PRINT "I am going to be evaluated by SBCL"))
Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [ABORT] Exit debugger, returning to top level.
(SB-INT:SIMPLE-EVAL-IN-LEXENV
(DECLARE (PRINT "I am going to be evaluated by SBCL"))
#<NULL-LEXENV>)
0]
Notice that the string is not printed - so, the evaluation does not occur even partially, and the error message is clear.
The fix is really trivial - just to add two lines to the evaluator code is enough.
SBCL behaviour after the fix:
* (declare (print "I am going to be evaluated by SBCL"))
debugger invoked on a SIMPLE-ERROR in thread #<THREAD "initial thread" RUNNING
{A9EB801} >:
(PRINT
"I am going to be evaluated by SBCL"))
Declarations are not allowed here: (DECLARE
Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
restarts (invokable by number or by possibly- abbreviated name):
0: [ABORT] Exit debugger, returning to top level.
(SB-INT: SIMPLE- EVAL-IN- LEXENV
(DECLARE (PRINT "I am going to be evaluated by SBCL"))
#<NULL-LEXENV>)
0]
Notice that the string is not printed - so, the evaluation does not occur even partially, and the error message is clear.
Regards,
Roman