<html>
 <head>
     <title>CL Unification: Class VECTOR-TEMPLATE</title>
     <link rel="stylesheet" href="main.css">
 </head>
	
 <body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0" bgcolor="#ffffff">

 <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%" vspace="0" hspace="0">
  <tr>
  <td colspan="3">
   <div class="header"
        style="font-family:=Verdana,Arial,Helvetica; font-size: 18px; color: #41286f;">
    <strong><i>CL Unification: Class VECTOR-TEMPLATE</title></i></strong>
    <div class="navigation">
     <a href="index.html" class="navigation-link">Home</a>
      | <a href="unification-package.html" class="navigation-link">Previous</a>
      | <a href="index.html" class="navigation-link">Next</a>
      | <a href="downloads.html" class="navigation-link">Downloads</a>
      |  <a href="links.html" class="navigation-link">Links</a>
    </div>
   </div>
   <div class="black-line"><img src="images/shim.gif" height="1" width="1"></div>
   <div class="middle-bar"><img src="images/shim.gif" height="5" width="1"></div>
   <div class="black-line"><img src="images/shim.gif" height="1" width="1"></div>
  </td>
 </tr>

 <tr height="100%">
  <td height="100%">&nbsp;</td>
  <td valign="top" width="80%" height="100%">

  <div class="content">
  <div class="text" style="padding-top: 10px;">
	
  <h1><i>Class</i> <strong>VECTOR-TEMPLATE</strong></h1>

  <h2>Package:</h2>

  <p><code>COMMON-LISP.EXTENSIONS.DATA-AND-CONTROL-FLOW.UNIFICATION</code></p>


  <h2>Class Precedence List:</h2>

  <p>
  VECTOR-TEMPLATE, SEQUENCE-TEMPLATE, ARRAY-TEMPLATE, TYPE-TEMPLATE, TEMPLATE, STANDARD-OBJECT, T.
  </p>

  <h2>Known Subclasses:</h2>

  <p>
  STRING-TEMPLATE.
  </p>


  <h2>Slots:</h2>

  <p>None.</p>


  <h2>Description:</h2>

  <p>The VECTOR-TEMPLATE class denotes those object  that are used
  to unify against a VECTOR.</p>

  <h3>Template Syntax:</h3>

  <p>
  <pre>
  #T(<b>vector</b> . <i>&lt;destructuring template lambda list&gt;</i>)
  </pre>
  </p>

  <p>
  <pre>
  #T(<i>&lt;<strong>CL</strong> vector type specifier&gt;</i> . <i>&lt;destructuring template lambda list&gt;</i>)
  </pre>
  </p>


  <p>The VECTOR-TEMPLATE syntax denotes a VECTOR object.  A
  VECTOR-TEMPLATE must be unified against an VECTOR object. The elements
  of the array must be unified against the
  <i>&lt;destructuring template lambda list&gt;</i>
  

  <h2>Examples:</h2>

  <p>
  <pre>
  cl-prompt> (setf e (unify #(0 1 42 3 4 5) #T(<b>vector</b> 0 1 ?x 3 4 5)))
  #&lt;ENVIRONMENT xxx&gt;
  
  cl-prompt> (find-variable-value '?x e)
  42

  cl-prompt> (setq e (unify #(0 1 42 3 4 5)  #T(<b>vector</b> 0 1 "FOO" 3 4 5)))
  --> Error: UNIFICATION-FAILURE

  cl-prompt> (setq e (unify #("foo" "bar" 42)) #T(<b>vector</b> _ _ ?x))
  #&lt;ENVIRONMENT xxx&gt;

  cl-prompt> (find-variable-value '?x e)
  42

  cl-prompt> (setq e (unify #("foo" "bar" 42) #T(<b>vector</b> _ &rest ?x)))
  #&lt;ENVIRONMENT xxx&gt;

  cl-prompt> (find-variable-value '?x e)
  #("bar" 42)

  cl-prompt> (setq e (unify #("foo" "bar" 42) #T((<b>vector</b> fixnum) _ &rest ?x)))
  --> Error: UNIFICATION-FAILURE
  </pre>
  </p>


  <h2>Affected By:</h2>

  <p>None.</p>


  <h2>Exceptional Situations:</h2>

  <p>Unifying an VECTOR-TEMPLATE against a non-VECTOR object results in
  an UNIFICATION-FAILURE error being signaled.</p>


  <h2>See Also:</h2>

  <p>UNIFY</p>


  <h2>Notes:</h2>

  <h3>ARRAY Structural Properties</h3>

  <p>There is no way to "unify" against structural properties of
  vectors like fill pointers and displacements.</p>

  <h3>Current Implementation Note</h3>

  <p>Type checking for templates like
  <code>#T((<b>vector</b> fixnum) 1 2 3)</code>
  is not yet implemented.</p>

 </td>
 
 <!--  <td height="100%">&nbsp;</td> -->
 </tr>

 <tr height="100%">
  <td height="100%">&nbsp;</td>
  <td valign="top" width="80%" height="100%">

  <div class="content">
  <div class="text" style="padding-top: 10px;">

  <h1>News</h1>

  <p>News in chronological order, most recent on top.
  </p>

  <ul>
  <li><strong>2004-10-30</strong><br>
      Completed description.
  </li>

  </ul>

  </div>
  </div>
						
 </td>
 
 <td height="100%">&nbsp;</td>
 </tr>



 
 <tr>
  <td colspan="3" valign="bottom" align="right">
  <div class="copyright">
  &copy; 2003-2004, Marco Antoniotti, all rights reserved.
  </div>
  </td>
 </tr>
 
 </table>
 </body>
</html>

<!-- end of file -- expression-template-class.html -->