<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Yep. That makes sense. The only caveat is that VECTOR-TEMPLATEs check some extra features of vectors.<div>The unifier does not do much with this at this time, but it could.</div><div><br></div><div>In any case, go ahead with the patch. Nothing will prevent us from re-introducing a more specialized</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span><font class="Apple-style-span" face="'Courier New'"><b>unify (a vector) (vt vector-template)</b></font></div><div><br></div><div>later on.</div><div><br></div><div>Cheers</div><div><br></div><div><div><br></div><div>Marco</div><div><br></div><div><br></div><div><br><div><div>On Feb 17, 2011, at 21:19 , Robert Brown wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>I think vectors should unify with sequence templates. This expression<br><br> (unify #(0 1 42 3 4 5) #T(sequence 0 1 ?x 3 4 5))<br><br>currently fails. How does the following patch look?<br><br>bob<br><br>==========<br><br><br>*** test/unification-tests.lisp#1<span class="Apple-tab-span" style="white-space:pre"> </span>Wed Feb 16 16:51:33 2011<br>--- test/unification-tests.lisp<span class="Apple-tab-span" style="white-space:pre"> </span>Thu Feb 17 15:06:27 2011<br>***************<br>*** 99,104 ****<br>--- 99,106 ----<br> (test t (unify:environment-p (unify #C(0 1) #T(complex #C(0 1)))))<br><br> (test '(42 T) (v? '?x (unify #T(number ?x) 42)) :multiple-values t)<br>+ (test '(42 T) (v? '?x (unify #(0 1 42 3 4 5) #T(sequence 0 1 ?x 3 4 5)))<br>+ :multiple-values t)<br><br> (test-error (unify 42 #T(float 42.0))<br> :condition-type 'unification-failure<br><br>*** unifier.lisp#1<span class="Apple-tab-span" style="white-space:pre"> </span>Wed Feb 16 16:51:33 2011<br>--- unifier.lisp<span class="Apple-tab-span" style="white-space:pre"> </span>Thu Feb 17 15:09:24 2011<br>***************<br>*** 476,482 ****<br> :format-arguments (list a b)))<br><br><br>! (defmethod unify ((a vector) (b vector-template)<br> &optional (env (make-empty-environment))<br> &key &allow-other-keys)<br> (let ((template-lambda-list (sequence-template-lambda-list b))<br>--- 476,482 ----<br> :format-arguments (list a b)))<br><br><br>! (defmethod unify ((a vector) (b sequence-template)<br> &optional (env (make-empty-environment))<br> &key &allow-other-keys)<br> (let ((template-lambda-list (sequence-template-lambda-list b))<br><br>_______________________________________________<br>cl-unification-devel site list<br><a href="mailto:cl-unification-devel@common-lisp.net">cl-unification-devel@common-lisp.net</a><br>http://common-lisp.net/mailman/listinfo/cl-unification-devel<br><br></div></blockquote></div><br><div>--<br>Marco Antoniotti<br><br></div><br></div></div></body></html>