Generic Function: UPDATE-PERSISTENT-INSTANCE-FOR-REDEFINED-CLASS

Source

(defgeneric update-persistent-instance-for-redefined-class
    (instance added-slots discarded-slots property-list &key)
  (:method ((instance persistent-object) added-slots discarded-slots plist
            &key)
   ;; Default method: ignore the discarded slots and initialize added slots
   ;; according to their initforms.  We do this 'by hand' and not by calling
   ;; SHARED-INITIALIZE because slot indexes may need to be updated too.
   (let ((slots (class-slots (class-of instance))))
     (loop for slot-name in added-slots
           for slot = (find slot-name slots :key #'slot-definition-name)
           for initfunction = (and slot
                                   (slot-definition-initfunction slot))
           when initfunction
           ;; NOTE: We don't handle initargs, and I think we don't need to.
           ;; We follow the CLHS description of UPDATE-INSTANCE-FOR-REDEFINED-CLASS,
           ;; which says: "When it is called by the system to update an
           ;; instance whose class has been redefined, no initialization
           ;; arguments are provided." 
           do (setf (slot-value instance slot-name) (funcall initfunction))))))
Source Context