From: Mark Wooding Date: Tue, 23 Jun 2020 09:22:32 +0000 (+0100) Subject: doc/misc.tex: Describe a couple of default methods explicitly. X-Git-Url: https://git.distorted.org.uk/~mdw/sod/commitdiff_plain/f8a8e8ad68c3cac26b2c76c6d34becc6db01144e doc/misc.tex: Describe a couple of default methods explicitly. On `instance-initargs' and `copy-instance-using-class'. --- diff --git a/doc/misc.tex b/doc/misc.tex index 023f4e3..4d80a5d 100644 --- a/doc/misc.tex +++ b/doc/misc.tex @@ -256,9 +256,16 @@ metaobject protocol. \begin{describe}{gf}{instance-initargs @ @> @} Return a fresh list of plausible initargs for the given @. - This is done by digging through the instance's class's slot definitions and - enquiring about their initargs. Initargs which are handled by methods on - @|shared-initialize| or similar generic functions won't be discovered. + The default method should work for most classes, but may be overridden to + cope with special effects. + + \begin{describe}{meth}{standard-object} + {instance-initargs (@ standard-object) @> @} + The default method works by digging through the instance's class's slot + definitions and enquiring about their initargs. Initargs which are + handled by methods on @|shared-initialize| or similar generic functions + won't be discovered. + \end{describe} \end{describe} \begin{describe*} @@ -275,18 +282,24 @@ metaobject protocol. that generic function. The default method on @|copy-instance-using-class| should work for most - classes, but may be overridden to cope with special effects. It works as - follows. - \begin{enumerate} - \item Allocate a fresh instance of @, using @|allocate-instance|. - \item For each slot defined by @, if that slot is bound in the - original instance, then set the corresponding slot in the new instance to - the same value. - \item Call @|shared-initialize| on the new instance, providing it the given - list of @, but inhibiting the usual initialization of slots - from their initforms. - \item Return the new instance. - \end{enumerate} + classes, but may be overridden to cope with special effects. + + \begin{describe}{meth}{standard-class} + {copy-instance-using-class \=(@ standard-class) @ \\ + \>\&rest initargs + \nlret @} + The default method works as follows. + \begin{enumerate} + \item Allocate a fresh instance of @, using @|allocate-instance|. + \item For each slot defined by @, if that slot is bound in the + original instance, then set the corresponding slot in the new instance + to the same value. + \item Call @|shared-initialize| on the new instance, providing it the + given list of @, but inhibiting the usual initialization of + slots from their initforms. + \item Return the new instance. + \end{enumerate} + \end{describe} \end{describe*} \begin{describe*}