non-standard attempts to evaluate declarations
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
SBCL | Status tracked in Trunk | |||||
Trunk |
Fix Released
|
Wishlist
|
Unassigned |
Bug Description
CLHS says that "The consequences of attempting to evaluate a declare expression are undefined. In situations where such expressions can appear, explicit checks are made for their presence and they are never actually evaluated". But SBCL evaluates them, at least it tries. For example, entering this code
(declare (print "I am going to be evaluated by SBCL"))
yields the next output:
"I am going to be evaluated by SBCL"
debugger invoked on a UNDEFINED-FUNCTION in thread #<THREAD
The function DECLARE is undefined.
Note that at least partial evaluation of the declaration occurs - the string is printed. Also, the error message is confusing - it seems that the evaluation wants to go further and fails on #'declare being undefined.
CLISP and Lispworks do not have this bug. For example, in CLISP:
(declare (print "I am going to be evaluated by CLISP"))
*** - declarations ((PRINT "I am going to be evaluated by CLISP")) are not
allowed here
The following restarts are available:
ABORT :R1 Abort main loop
Break 1 [4]>
The error message is also clear.
Regards,
Roman
Changed in sbcl: | |
assignee: | nobody → Roman Marynchak (roman-marynchak) |
status: | Confirmed → In Progress |
tags: | added: review |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
"For example, entering this code..."
Entering it where? A place where such an expression can occur?