[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


It was suggested that there be a general facility in CLOS to reinitialize an
instance.  It would then be used for updating classes and generic functions.

The following is a strawman proposal for the standard method for

(defmethod reinitialize-instance
   ((instance standard-object) &rest reinit-args &key &allow-other-keys)
   (apply #'initialize-instance
       (default-initargs (class-of instance) reinit-args)))

This uses the code for initialize-instance to do whatever it would ordinarily
do, using the standard defaulting method for the arguments.  It also allows
users to write :before and :after methods on reinitialize-instance to take
special actions for reinitialization.

Potential problems
1) There is no argument legality checking.
2) reinitialize-instance does not see the defaulted list of initargs