1 <html> 2 <head> 3 <title>CL Unification: Macro MATCH</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: Macro MATCH</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>Macro</i> <strong>MATCH</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>Syntax:</h2> 44 45 46 <p> 47 <pre> 48 <b>match</b> (<i>template</i> <i>object</i> &key <i>substitution</i> <i>errorp</i> <i>error-value</i>) &body <i>forms</i> 49 => <i>results</i>* 50 </pre> 51 </p> 52 53 <h3>Arguments and Values:</h3> 54 55 <p><i><code>template</code></i>---a <i>unification template</i> 56 <p><i><code>object</code></i>---an <i>object</i> 57 <p><i><code>substitution</code></i>---a <i>substitution</i> 58 <p><i><code>errorp</code></i>---a <i>generalized boolean</i> 59 <p><i><code>error-value</code></i>---an <i>object</i> 60 <p><i><code>forms</code></i>---an <i>implicit progn</i> 61 <p><i><code>results</code></i>---the <i>values</i> returned by <i>forms</i> 62 63 64 65 66 <h2>Description:</h2> 67 68 <p> 69 MATCH sets up a lexical environment to evaluate <i>forms</i> after a unification operation. 70 MATCH unifies a <i>template</i> and an <i>object</i> and then sets up a lexical 71 environment where the variables present in the template are bound 72 lexically. Note that both variable names '?FOO' and 'FOO' are bound 73 for convenience.</p> 74 75 <p>The MATCH form returns the values returned by the evaluation of the 76 last of the <i>forms</i>.</p> 77 78 <p>If <i>errorp</i> is non-NIL (the default) then the form raises a 79 UNIFICATION-FAILURE, otherwise the result of evaluating <i>error-value</i>, 80 whose default is NIL is returned.</p> 81 82 83 <h2>Affected By:</h2> 84 85 <p>None.</p> 86 87 88 <h2>Exceptional Situations:</h2> 89 90 <p>See above.</p> 91 92 93 <h2>See Also:</h2> 94 95 <p>UNIFY, UNIFICATION-FAILURE</p> 96 97 <h2>Notes:</h2> 98 99 <p>Note that UNIFICATION-FAILUREs 100 raising from the evaluation of <i>forms</i> will also be caught and handled by the enclosing MATCH 101 according to <i>errorp</i> settings.</p> 102 103 104 </td> 105 106 <!-- <td height="100%"> </td> --> 107 </tr> 108 109 <tr height="100%"> 110 <td height="100%"> </td> 111 <td valign="top" width="80%" height="100%"> 112 113 <div class="content"> 114 <div class="text" style="padding-top: 10px;"> 115 116 <h1>News</h1> 117 118 <p>News in chronological order, most recent on top. 119 </p> 120 121 <ul> 122 <li><strong>2004-06-11</strong><br> 123 Completed description. 124 </li> 125 126 </ul> 127 128 </div> 129 </div> 130 131 </td> 132 133 <td height="100%"> </td> 134 </tr> 135 136 137 138 139 <tr> 140 <td colspan="3" valign="bottom" align="right"> 141 <div class="copyright"> 142 © 2003-2004, Marco Antoniotti, all rights reserved. 143 </div> 144 </td> 145 </tr> 146 147 </table> 148 </body> 149 </html> 150 151 <!-- end of file -- usci-variable.html -->