1 <html> 2 <head> 3 <title>CL Unification: Class STRUCTURE-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 STRUCTURE-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%"> </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>STRUCTURE-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 STRUCTURE-OBJECT-TEMPLATE, TYPE-TEMPLATE, TEMPLATE, STRUCTURE-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 STRUCTURE-OBJECT-TEMPLATE class denotes those object that are used 64 to unify against any STRUCTURE-OBJECT.</p> 65 66 67 <h3>Template Syntax:</h3> 68 69 <p> 70 <pre> 71 #T(<i><<strong>CL</strong> structure class designator></i> [<i><reader function></i> <i><object></i>]*) 72 </pre> 73 </p> 74 75 <p>The STRUCTURE-OBJECT-TEMPLATE syntax denotes any 76 <strong>CL</strong> object that is an instance of a 77 STRUCTURE-OBJECT. The syntax is such that the <i><reader 78 function></i> gets called against the instance against 79 which the STRUCTURE-OBJECT-TEMPLATE is being UNIFYed. 80 <i><object></i> can be any <strong>CL</strong> object, 81 including a TEMPLATE (in which case the unification machinery 82 proceeds recursively.)</p> 83 84 85 <h2>Examples:</h2> 86 87 <p> 88 <pre> 89 cl-prompt> (defstruct foo () (a 42)) 90 FOO 91 92 cl-prompt> (defstruct (baz (:include foo)) (b 33)) 93 BAZ 94 95 cl-prompt> (setf e (unify (make-foo) #T(<em>foo</em> <em>foo-a</em> 42))) 96 #<ENVIRONMENT xxx> 97 98 cl-prompt> (setf e (unify (make-baz) #T(<em>foo</em> <em>foo-a</em> 42))) 99 #<ENVIRONMENT xxx> 100 101 cl-prompt> (find-variable-value '?x e) 102 42 103 T 104 105 cl-prompt> (setf e (unify (make-instance 'bar) #T(<em>foo</em> <em>foo-a</em> 42))) 106 #<ENVIRONMENT xxx> 107 108 cl-prompt> (find-variable-value '?x e) 109 42 110 T 111 112 cl-prompt> (setf e (unify (make-instance 'baz) #T(<em>baz</em> <em>the-a-in-baz</em> 42))) 113 #<ENVIRONMENT xxx> 114 115 cl-prompt> (find-variable-value '?x e) 116 42 117 T 118 119 cl-prompt> (setf e (unify (make-instance 'baz :b '?e) #T(<em>baz</em> <em>bazb</em> 42))) 120 #<ENVIRONMENT xxx> 121 122 cl-prompt> (find-variable-value '?x e) 123 42 124 T 125 126 cl-prompt> (setf e (unify (make-instance 'bar) #T(<em>baz</em> <em>foo-a</em> 42))) 127 --> Error: UNIFICATION-FAILURE 128 </pre> 129 </p> 130 131 132 <h2>Affected By:</h2> 133 134 <p>None.</p> 135 136 137 <h2>Exceptional Situations:</h2> 138 139 <p>Unifying a STRUCTURE-OBJECT-TEMPLATE against a non-STRUCTURE-OBJECT object results in 140 an UNIFICATION-FAILURE error being signaled.</p> 141 142 <p>Unifying a STRUCTURE-OBJECT-TEMPLATE denoting an instance of structure 143 S1 against an instance of structure S2, results in 144 an UNIFICATION-FAILURE error being signaled, when S1 is not in the 145 class precedence list of S2.</p> 146 147 148 <h2>See Also:</h2> 149 150 <p>UNIFY</p> 151 152 153 <h2>Notes:</h2> 154 155 <p>None.</p> 156 157 158 </td> 159 160 <!-- <td height="100%"> </td> --> 161 </tr> 162 163 <tr height="100%"> 164 <td height="100%"> </td> 165 <td valign="top" width="80%" height="100%"> 166 167 <div class="content"> 168 <div class="text" style="padding-top: 10px;"> 169 170 <h1>News</h1> 171 172 <p>News in chronological order, most recent on top. 173 </p> 174 175 <ul> 176 <li><strong>2004-10-30</strong><br> 177 Completed description. 178 </li> 179 180 </ul> 181 182 </div> 183 </div> 184 185 </td> 186 187 <td height="100%"> </td> 188 </tr> 189 190 191 192 193 <tr> 194 <td colspan="3" valign="bottom" align="right"> 195 <div class="copyright"> 196 © 2003-2004, Marco Antoniotti, all rights reserved. 197 </div> 198 </td> 199 </tr> 200 201 </table> 202 </body> 203 </html> 204 205 <!-- end of file -- expression-template-class.html -->