2008-12-19 12:25:20 |
Nikodemus Siivola |
description |
When redefining an accessor, SB-PCL::FIX-SLOT-ACCESSORS may try to
find the generic function named by the old accessor name using
ENSURE-GENERIC-FUNCTION and then remove the old accessor's method in
the GF. If the old name does not name a function, or if the old name
does not name a generic function, no attempt to find the GF or remove
any methods is made.
However, if an unrelated GF with an incompatible lambda list exists,
the class redefinition will fail when SB-PCL::REMOVE-READER-METHOD
tries to find and remove a method with an incompatible lambda list
from the unrelated generic function. |
When redefining an accessor, SB-PCL::FIX-SLOT-ACCESSORS may try to
find the generic function named by the old accessor name using
ENSURE-GENERIC-FUNCTION and then remove the old accessor's method in
the GF. If the old name does not name a function, or if the old name
does not name a generic function, no attempt to find the GF or remove
any methods is made.
However, if an unrelated GF with an incompatible lambda list exists,
the class redefinition will fail when SB-PCL::REMOVE-READER-METHOD
tries to find and remove a method with an incompatible lambda list
from the unrelated generic function.
Presumbly the "right" thing would be to offer a restart to replace the generic function?
Example:
(defclass foo ()
((slot :accessor foo-slot)))
(fmakunbound 'foo-slot)
(defgeneric foo-slot (x y z))
(defclass foo ()
((slot :accessor foo-slot)))
|
|
2008-12-19 12:30:13 |
Nikodemus Siivola |
description |
When redefining an accessor, SB-PCL::FIX-SLOT-ACCESSORS may try to
find the generic function named by the old accessor name using
ENSURE-GENERIC-FUNCTION and then remove the old accessor's method in
the GF. If the old name does not name a function, or if the old name
does not name a generic function, no attempt to find the GF or remove
any methods is made.
However, if an unrelated GF with an incompatible lambda list exists,
the class redefinition will fail when SB-PCL::REMOVE-READER-METHOD
tries to find and remove a method with an incompatible lambda list
from the unrelated generic function.
Presumbly the "right" thing would be to offer a restart to replace the generic function?
Example:
(defclass foo ()
((slot :accessor foo-slot)))
(fmakunbound 'foo-slot)
(defgeneric foo-slot (x y z))
(defclass foo ()
((slot :accessor foo-slot)))
|
When redefining an accessor, SB-PCL::FIX-SLOT-ACCESSORS may try to
find the generic function named by the old accessor name using
ENSURE-GENERIC-FUNCTION and then remove the old accessor's method in
the GF. If the old name does not name a function, or if the old name
does not name a generic function, no attempt to find the GF or remove
any methods is made.
However, if an unrelated GF with an incompatible lambda list exists,
the class redefinition will fail when SB-PCL::REMOVE-READER-METHOD
tries to find and remove a method with an incompatible lambda list
from the unrelated generic function.
If Nikodemus understands this bug correctly, this has been fixed somewhere
in the 0.8.21.45 - 1.0.23 interval. Test-case below.
(defclass foo ()
((slot :accessor foo-slot)))
(fmakunbound 'foo-slot)
(defgeneric foo-slot (x y z))
(defclass foo ()
((slot :accessor foo-slot-value)))
|
|