updateInstanceForRedefinedClass
updateInstanceForRedefinedClass(g_objl_addedSlotsl_deletedSlotsl_dplList) =>t
Description
A generic function, which is called to update all instances of a class, when a class redefinition occurs.
The primary method of updateInstanceForRedefinedClass checks the validity of initargs and throws an error if the provided initarg is not declared. It then initializes slots with values according to the initargs, and initializes the newly added-slots with values according to their initform forms.
When a class is redefined and an instance is being updated, a property-list is created that captures the slot names and values of all the discarded slots with values in the original instance. The structure of the instance is transformed so that it conforms to the current class definition.
The arguments of updateInstanceForRedefinedClass are the transformed instance, a list of slots added to the instance, a list of slots deleted from the instance, and the property list containing the slot names and values of slots that were discarded. This list of discarded slots contains slots that were local in the old class and are shared in the new class.
Arguments
Value Returned
Examples
Define a method for the class myClass (to be applied to all instances of myClass if it is redefined):
(defmethod updateInstanceForRedefinedClass ((obj myClass) added deleted
dplList @rest initargs)
;;callNextMethod for obj and pass ?arg "myArg" value for slot arg
(apply callNextMethod obj added deleted dplList ?arg "myArg" initargs)
Related Topics
Return to top