I think vectors should unify with sequence templates. This expression
(unify #(0 1 42 3 4 5) #T(sequence 0 1 ?x 3 4 5))
currently fails. How does the following patch look?
bob
==========
*** test/unification-tests.lisp#1 Wed Feb 16 16:51:33 2011 --- test/unification-tests.lisp Thu Feb 17 15:06:27 2011 *************** *** 99,104 **** --- 99,106 ---- (test t (unify:environment-p (unify #C(0 1) #T(complex #C(0 1)))))
(test '(42 T) (v? '?x (unify #T(number ?x) 42)) :multiple-values t) + (test '(42 T) (v? '?x (unify #(0 1 42 3 4 5) #T(sequence 0 1 ?x 3 4 5))) + :multiple-values t)
(test-error (unify 42 #T(float 42.0)) :condition-type 'unification-failure
*** unifier.lisp#1 Wed Feb 16 16:51:33 2011 --- unifier.lisp Thu Feb 17 15:09:24 2011 *************** *** 476,482 **** :format-arguments (list a b)))
! (defmethod unify ((a vector) (b vector-template) &optional (env (make-empty-environment)) &key &allow-other-keys) (let ((template-lambda-list (sequence-template-lambda-list b)) --- 476,482 ---- :format-arguments (list a b)))
! (defmethod unify ((a vector) (b sequence-template) &optional (env (make-empty-environment)) &key &allow-other-keys) (let ((template-lambda-list (sequence-template-lambda-list b))