1
0
Fork 0
cl-sites/www.cs.cmu.edu/Groups/AI/html/cltl/clm/node309.html
2023-10-25 11:23:21 +02:00

59 lines
3 KiB
HTML

<!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.12. Reinitializing an Instance</TITLE>
</HEAD>
<BODY>
<meta name="description" value=" Reinitializing an Instance">
<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=tex2html5514 HREF="node310.html"><IMG ALIGN=BOTTOM ALT="next" SRC="icons/next_motif.gif"></A> <A NAME=tex2html5512 HREF="node261.html"><IMG ALIGN=BOTTOM ALT="up" SRC="icons/up_motif.gif"></A> <A NAME=tex2html5508 HREF="node308.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="icons/previous_motif.gif"></A> <A NAME=tex2html5516 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="icons/contents_motif.gif"></A> <A NAME=tex2html5517 HREF="index.html"><IMG ALIGN=BOTTOM ALT="index" SRC="icons/index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME=tex2html5515 HREF="node310.html"> Customizing Reinitialization</A>
<B>Up:</B> <A NAME=tex2html5513 HREF="node261.html"> Programmer Interface Concepts</A>
<B> Previous:</B> <A NAME=tex2html5509 HREF="node308.html"> Customizing the Change </A>
<HR> <P>
<H2><A NAME=SECTION0032112000000000000000>28.1.12. Reinitializing an Instance</A></H2>
<P>
<img align=bottom alt="change_begin" src="gif/change_begin.gif"><br>
<A NAME=ReinitializinganInstanceSECTION>The</A>
generic function <tt>reinitialize-instance</tt> may be used to change
the values of slots according to initialization arguments.
<P>
The process of reinitialization changes the values of some slots and
performs any user-defined actions.
<P>
Reinitialization does not modify the structure
of an instance to add or delete slots, and it does not use any
<tt>:initform</tt> forms to initialize slots.
<P>
The generic function <tt>reinitialize-instance</tt> may be called
directly. It takes one required argument, the instance. It also
takes any number of initialization arguments to be used by methods for
<tt>reinitialize-instance</tt> or for <tt>shared-initialize</tt>. The
arguments after the required instance must form an initialization
argument list.
<P>
There is a system-supplied primary method for
<tt>reinitialize-instance</tt> whose parameter specializer 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,
<tt>nil</tt>, and the initialization arguments it received.
<br><img align=bottom alt="change_end" src="gif/change_end.gif">
<P>
<HR>
<UL>
<LI> <A NAME=tex2html5518 HREF="node310.html#SECTION0032112100000000000000"> Customizing Reinitialization</A>
</UL>
<HR>
<P><ADDRESS>
AI.Repository@cs.cmu.edu
</ADDRESS>
</BODY>