emacs.d/clones/lisp/www.cs.cmu.edu/Groups/AI/html/cltl/clm/node302.html

64 lines
4 KiB
HTML
Raw Normal View History

2022-08-26 19:11:35 +02:00
<!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN">
<!Converted with LaTeX2HTML 0.6.5 (Tue Nov 15 1994) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds >
<HEAD>
<TITLE>28.1.10.2. Initializing Newly Added Local Slots</TITLE>
</HEAD>
<BODY>
<meta name="description" value=" Initializing Newly Added Local Slots">
<meta name="keywords" value="clm">
<meta name="resource-type" value="document">
<meta name="distribution" value="global">
<P>
<b>Common Lisp the Language, 2nd Edition</b>
<BR> <HR><A NAME=tex2html5433 HREF="node303.html"><IMG ALIGN=BOTTOM ALT="next" SRC="icons/next_motif.gif"></A> <A NAME=tex2html5431 HREF="node300.html"><IMG ALIGN=BOTTOM ALT="up" SRC="icons/up_motif.gif"></A> <A NAME=tex2html5425 HREF="node301.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="icons/previous_motif.gif"></A> <A NAME=tex2html5435 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="icons/contents_motif.gif"></A> <A NAME=tex2html5436 HREF="index.html"><IMG ALIGN=BOTTOM ALT="index" SRC="icons/index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME=tex2html5434 HREF="node303.html"> Customizing Class Redefinition</A>
<B>Up:</B> <A NAME=tex2html5432 HREF="node300.html"> Redefining Classes</A>
<B> Previous:</B> <A NAME=tex2html5426 HREF="node301.html"> Modifying the Structure </A>
<HR> <P>
<H3><A NAME=SECTION0032110200000000000000>28.1.10.2. Initializing Newly Added Local Slots</A></H3>
<P>
<img align=bottom alt="change_begin" src="gif/change_begin.gif"><br>
The second step initializes the newly added local slots and performs
any other user-defined actions. This step is implemented by the generic
function <tt>update-instance-for-redefined-class</tt>, which is called after
completion of the first step of modifying the structure of the
instance.
<P>
The generic function <tt>update-instance-for-redefined-class</tt> takes
four required arguments: the instance being updated after it has
undergone the first step, a list of the names of local slots that were
added, a list of the names of local slots that were discarded, and a
property list containing the slot names and values of slots that were
discarded and had values. Included among the discarded slots are
slots that were local in the old class and that are shared in the new
class.
<P>
The generic function <tt>update-instance-for-redefined-class</tt> also
takes any number of initialization arguments. When it is called by
the system to update an instance whose class has been redefined, no
initialization arguments are provided.
<P>
There is a system-supplied primary method for the generic function
<tt>update-instance-for-redefined-class</tt> whose parameter specializer for
its instance argument is the class <tt>standard-object</tt>. First this
method checks the validity of initialization arguments and signals an
error if an initialization argument is supplied that is not declared
valid (see
section <A HREF="node294.html#DeclaringtheValidityofInitializationArgumentsSECTION">28.1.9.2</A>.)
Then it calls the generic function
<tt>shared-initialize</tt> with the following arguments: the instance,
the list of names of the newly added slots, and the initialization
arguments it received.
<br><img align=bottom alt="change_end" src="gif/change_end.gif">
<P>
<BR> <HR><A NAME=tex2html5433 HREF="node303.html"><IMG ALIGN=BOTTOM ALT="next" SRC="icons/next_motif.gif"></A> <A NAME=tex2html5431 HREF="node300.html"><IMG ALIGN=BOTTOM ALT="up" SRC="icons/up_motif.gif"></A> <A NAME=tex2html5425 HREF="node301.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="icons/previous_motif.gif"></A> <A NAME=tex2html5435 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="icons/contents_motif.gif"></A> <A NAME=tex2html5436 HREF="index.html"><IMG ALIGN=BOTTOM ALT="index" SRC="icons/index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME=tex2html5434 HREF="node303.html"> Customizing Class Redefinition</A>
<B>Up:</B> <A NAME=tex2html5432 HREF="node300.html"> Redefining Classes</A>
<B> Previous:</B> <A NAME=tex2html5426 HREF="node301.html"> Modifying the Structure </A>
<HR> <P>
<HR>
<P><ADDRESS>
AI.Repository@cs.cmu.edu
</ADDRESS>
</BODY>