/ docs / html /
/docs/html/matching-macro.html
  1 <html>
  2  <head>
  3      <title>CL Unification: Macro MATCHING</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 MATCHING</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>Macro</i> <strong>MATCHING</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>matching</b> (&amp;key <i>errorp</i>) &lt;clause&gt;*</i>
 49   => <i>results</i>*
 50   </pre>
 51   </p>
 52 
 53   <p>
 54   <pre>
 55   &lt;clause&gt;         ::= &lt;regular clause&gt; | &lt;default clause&gt;
 56   &lt;regular clause&gt; ::= ((<i>template</i> <i>object</i>) &amp;body <i>forms</i>)
 57   &lt;default clause&gt; ::= (t &amp;body <i>forms</i>)
 58                    |   (otherwise &amp;body <i>forms</i>)
 59   </pre>
 60   </p>
 61 
 62   <h3>Arguments and Values:</h3>
 63 
 64   <p><i><code>template</code></i>---a <i>unification template</i>
 65   <p><i><code>object</code></i>---an <i>object</i>
 66   <p><i><code>substitution</code></i>---a <i>substitution</i>
 67   <p><i><code>errorp</code></i>---a <i>generalized boolean</i>
 68   <p><i><code>error-value</code></i>---an <i>object</i>
 69   <p><i><code>forms</code></i>---an <i>implicit progn</i>
 70   <p><i><code>results</code></i>---the <i>values</i> returned by <i>forms</i>
 71 
 72 
 73 
 74 
 75   <h2>Description:</h2>
 76 
 77   <p>MATCHING sets up a COND-like environment for multiple template matching clauses.
 78   Each clause evaluates its forms in an environment where the variables
 79   present in the template are bound lexically.  Note that both variable
 80   names '?FOO' and 'FOO' are bound for convenience.</p>
 81 
 82   <p>The values returned by the MATCHING form are those of the last form in
 83   the first clause that satisfies the match test.</p>
 84 
 85   <p>If <i>errorp</i> is non-NIL then if none of the regular clauses matches, then
 86   an error of type UNIFICATION-NON-EXHAUSTIVE is signalled, regardless of
 87   any default clause.  Otherwise, the default clause behaves as a
 88   standard COND default clause.  The default value of <i>errorp</i> is NIL.</p>
 89 
 90   <h2>Affected By:</h2>
 91 
 92   <p>None.</p>
 93 
 94 
 95   <h2>Exceptional Situations:</h2>
 96 
 97   <p>See above.</p>
 98 
 99 
100   <h2>See Also:</h2>
101 
102   <p>UNIFY, UNIFICATION-FAILURE, UNIFICATION-NON-EXHAUSTIVE</p>
103 
104   <h2>Notes:</h2>
105 
106   <p>Note that UNIFICATION-FAILUREs
107   raising from the evaluation of <i>forms</i> in each clause will
108   <em>not</em> be caught and handled by the enclosing MATCHING block..</p>
109 
110 
111  </td>
112  
113  <!--  <td height="100%">&nbsp;</td> -->
114  </tr>
115 
116  <tr height="100%">
117   <td height="100%">&nbsp;</td>
118   <td valign="top" width="80%" height="100%">
119 
120   <div class="content">
121   <div class="text" style="padding-top: 10px;">
122 
123   <h1>News</h1>
124 
125   <p>News in chronological order, most recent on top.
126   </p>
127 
128   <ul>
129   <li><strong>2004-06-11</strong><br>
130       Completed description.
131   </li>
132 
133   </ul>
134 
135   </div>
136   </div>
137 						
138  </td>
139  
140  <td height="100%">&nbsp;</td>
141  </tr>
142 
143 
144 
145  
146  <tr>
147   <td colspan="3" valign="bottom" align="right">
148   <div class="copyright">
149   &copy; 2003-2004, Marco Antoniotti, all rights reserved.
150   </div>
151   </td>
152  </tr>
153  
154  </table>
155  </body>
156 </html>
157 
158 <!-- end of file -- usci-variable.html -->