/ docs / html /
docs/html/standard-object-template-class.html
  1 <html>
  2  <head>
  3      <title>CL Unification: Class STANDARD-OBJECT-TEMPLATE</title>
  4      <link rel="stylesheet" href="main.css">
  5  </head>
  6 	
  7  <body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0" bgcolor="#ffffff">
  8 
  9  <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%" vspace="0" hspace="0">
 10   <tr>
 11   <td colspan="3">
 12    <div class="header"
 13         style="font-family:=Verdana,Arial,Helvetica; font-size: 18px; color: #41286f;">
 14     <strong><i>CL Unification: Class STANDARD-OBJECT-TEMPLATE</title></i></strong>
 15     <div class="navigation">
 16      <a href="index.html" class="navigation-link">Home</a>
 17       | <a href="unification-package.html" class="navigation-link">Previous</a>
 18       | <a href="index.html" class="navigation-link">Next</a>
 19       | <a href="downloads.html" class="navigation-link">Downloads</a>
 20       |  <a href="links.html" class="navigation-link">Links</a>
 21     </div>
 22    </div>
 23    <div class="black-line"><img src="images/shim.gif" height="1" width="1"></div>
 24    <div class="middle-bar"><img src="images/shim.gif" height="5" width="1"></div>
 25    <div class="black-line"><img src="images/shim.gif" height="1" width="1"></div>
 26   </td>
 27  </tr>
 28 
 29  <tr height="100%">
 30   <td height="100%">&nbsp;</td>
 31   <td valign="top" width="80%" height="100%">
 32 
 33   <div class="content">
 34   <div class="text" style="padding-top: 10px;">
 35 	
 36   <h1><i>Class</i> <strong>STANDARD-OBJECT-TEMPLATE</strong></h1>
 37 
 38   <h2>Package:</h2>
 39 
 40   <p><code>COMMON-LISP.EXTENSIONS.DATA-AND-CONTROL-FLOW.UNIFICATION</code></p>
 41 
 42 
 43   <h2>Class Precedence List:</h2>
 44 
 45   <p>
 46   STANDARD-OBJECT-TEMPLATE, TYPE-TEMPLATE, TEMPLATE, STANDARD-OBJECT, T.
 47   </p>
 48 
 49   <h2>Known Subclasses:</h2>
 50 
 51   <p>
 52   None.
 53   </p>
 54 
 55 
 56   <h2>Slots:</h2>
 57 
 58   <p>None.</p>
 59 
 60 
 61   <h2>Description:</h2>
 62 
 63   <p>The STANDARD-OBJECT-TEMPLATE class denotes those object that are used
 64   to unify against any STANDARD-OBJECT.</p>
 65 
 66 
 67   <h3>Template Syntax:</h3>
 68 
 69   <p>
 70   <pre>
 71   #T(<i>&lt;<strong>CL</strong> class designator&gt;</i> <i>&lt;slot&nbsp;spec&gt;</i>*)
 72 
 73   <i>&lt;slot&nbsp;spec&gt;</i> ::= <i>&lt;reader method&gt;</i> <i>&lt;object&gt;</i>
 74               |   (slot-value <i>&lt;slot name&gt;</i>) <i>&lt;object&gt;</i>
 75   </pre>
 76   </p>
 77 
 78   <p>The STANDARD-OBJECT-TEMPLATE syntax denotes any
 79   <strong>CL</strong> object that is an instance of a
 80   STANDARD-OBJECT.  The semantic of the template in a unification depends on which
 81   <i>&lt;slot&nbsp;spec&gt;</i>'s appear.  In the first case the meaning of
 82   <i>&lt;slot&nbsp;spec&gt;</i> is such that the
 83   <i>&lt;reader&nbsp;method&gt;</i> gets called against the instance
 84   against which the STANDARD-OBJECT-TEMPLATE is being UNIFYed.  In the
 85   second case, SLOT-VALUE is called with the instance being UNIFYed
 86   and <i>&lt;slot&nbsp;name&gt;</i>.  The result value of the call to either
 87   <i>&lt;reader&nbsp;method&gt;</i>, or SLOT-VALUE is UNIFYed against
 88   <i>&lt;object&gt;</i>.</p>
 89 
 90   <p><i>&lt;object&gt;</i> can be any <strong>CL</strong> object,
 91   including a TEMPLATE (in which case the unification machinery
 92   proceeds recursively.)</p>
 93   
 94 
 95   <h2>Examples:</h2>
 96 
 97   <p>
 98   <pre>
 99   cl-prompt> (defclass foo () ((a :initform 42 :accessor foo-a)))
100   #&lt;STANDARD-CLASS FOO XXXXX&gt;
101 
102   cl-prompt> (defclass bar (foo) ())
103   #&lt;STANDARD-CLASS BAR XXXXX&gt;
104 
105   cl-prompt> (defclass baz ()
106                ((a :reader the-a-in-a-baz)
107                 (b :accessor bazb :initarg :b)))
108   #&lt;STANDARD-CLASS BAZ XXXXX&gt;
109 
110   cl-prompt> (setf e (unify (make-instance 'foo) #T(<em>foo</em> <em>foo-a</em> 42)))
111   #&lt;ENVIRONMENT xxx&gt;
112 
113   cl-prompt> (setf e (unify (make-instance 'bar) #T(<em>foo</em> <em>foo-a</em> 42)))
114   #&lt;ENVIRONMENT xxx&gt;
115 
116   cl-prompt> (find-variable-value '?x e)
117   42
118   T
119 
120   cl-prompt> (setf e (unify (make-instance 'bar) #T(<em>foo</em> <em>foo-a</em> 42)))
121   #&lt;ENVIRONMENT xxx&gt;
122 
123   cl-prompt> (find-variable-value '?x e)
124   42
125   T
126 
127   cl-prompt> (setf e (unify (make-instance 'baz) #T(<em>baz</em> <em>the-a-in-baz</em> 42)))
128   #&lt;ENVIRONMENT xxx&gt;
129 
130   cl-prompt> (find-variable-value '?x e)
131   42
132   T
133 
134   cl-prompt> (setf e (unify (make-instance 'baz) #T(<em>baz</em> <em>(slot-value b)</em> 42)))
135   #&lt;ENVIRONMENT xxx&gt;
136 
137   cl-prompt> (find-variable-value '?x e)
138   42
139   T
140 
141   cl-prompt> (setf e (unify (make-instance 'baz :b '?e) #T(<em>baz</em> <em>bazb</em> 42)))
142   #&lt;ENVIRONMENT xxx&gt;
143 
144   cl-prompt> (find-variable-value '?x e)
145   42
146   T
147 
148   cl-prompt> (setf e (unify (make-instance 'bar) #T(<em>baz</em> <em>foo-a</em> 42)))
149   --> Error: UNIFICATION-FAILURE
150   </pre>
151   </p>
152 
153 
154   <h2>Affected By:</h2>
155 
156   <p>None.</p>
157 
158 
159   <h2>Exceptional Situations:</h2>
160 
161   <p>Unifying a STANDARD-OBJECT-TEMPLATE against a non-STANDARD-OBJECT object results in
162   an UNIFICATION-FAILURE error being signaled.</p>
163 
164   <p>Unifying a STANDARD-OBJECT-TEMPLATE denoting an instance of class
165   C1 against an instance of class C2, results in
166   an UNIFICATION-FAILURE error being signaled, when C1 is not in the
167   class precedence list of C2.</p>
168 
169 
170   <h2>See Also:</h2>
171 
172   <p>UNIFY</p>
173 
174 
175   <h2>Notes:</h2>
176 
177   <p>None.</p>
178 
179 
180  </td>
181  
182  <!--  <td height="100%">&nbsp;</td> -->
183  </tr>
184 
185  <tr height="100%">
186   <td height="100%">&nbsp;</td>
187   <td valign="top" width="80%" height="100%">
188 
189   <div class="content">
190   <div class="text" style="padding-top: 10px;">
191 
192   <h1>News</h1>
193 
194   <p>News in chronological order, most recent on top.
195   </p>
196 
197   <ul>
198   <li><strong>2004-10-30</strong><br>
199       Completed description.
200   </li>
201 
202   </ul>
203 
204   </div>
205   </div>
206 						
207  </td>
208  
209  <td height="100%">&nbsp;</td>
210  </tr>
211 
212 
213 
214  
215  <tr>
216   <td colspan="3" valign="bottom" align="right">
217   <div class="copyright">
218   &copy; 2003-2004, Marco Antoniotti, all rights reserved.
219   </div>
220   </td>
221  </tr>
222  
223  </table>
224  </body>
225 </html>
226 
227 <!-- end of file -- expression-template-class.html -->