optimized constructors don't see constant redefinitions
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Low
|
Unassigned |
Bug Description
from _death on #lisp (http://
CL-USER> (defconstant meaning-of-universe 41)
MEANING-OF-UNIVERSE
CL-USER> (defclass encapsulated ()
((thing :initarg :thing :reader thing)))
#<STANDARD-CLASS COMMON-
CL-USER> (defun encapsulate ()
ENCAPSULATE
CL-USER> (thing (encapsulate))
41
CL-USER> (defconstant meaning-of-universe 42) ;; pick 'continue' restart
MEANING-OF-UNIVERSE
CL-USER> meaning-of-universe
42
CL-USER> (defun encapsulate ()
WARNING: redefining COMMON-
ENCAPSULATE
CL-USER> (thing (encapsulate))
41
CL-USER> (lisp-implement
"1.3.11"
While redefining the constant is technically non-conformant, not seeing the new definition in a function compiled after the redefinition makes the continue restart less useful.
from #sbcl:
<scymtym> from a brief look, the MAKE-INSTANCE gets an optimized constructor
which is cached with the constant symbol as part of the key, leading
to the redefined function getting the same constructor [19:52]
Changed in sbcl: | |
status: | New → Confirmed |
importance: | Undecided → Low |
assignee: | nobody → Jan Moringen (scymtym) |
Changed in sbcl: | |
status: | Confirmed → Fix Committed |
assignee: | Jan Moringen (scymtym) → nobody |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |