[cl-unification-devel] Bugreport

Marco Antoniotti marcoxa at cs.nyu.edu
Wed Aug 24 22:41:57 UTC 2005


On Aug 24, 2005, at 5:38 PM, norman werner wrote:

>
> Hello
>
>
> (cl.ext.dacf.unification:unify #T(list 3 4) '(3 ))
> will result in an error.

If the error is UNIFICATION-FAILURE, then it is correct.  What is the  
error signalled?

Cheers
--
Marco







> I don't really understand the following code but i think the problem is
> in "(unify (subseq a 0 (list-length vars)) vars env))".
> I don't know how to fix this right.
>
> A temporary solution could be to do something like
>
> (when (< (length a) (length vars))
>   (error 'unification-failurse))
>
>
> Greetings
>
>  Norman
>
>
>
>
> (defmethod unify ((a list) (b sequence-template) &optional (env  
> (make-empty-environment)))
>   (let ((template-lambda-list (sequence-template-lambda-list b))
>         (ll (list-length a))
>         )
>     (multiple-value-bind (vars optionals keys rest)
>         (parse-extended-ordinary-lambda-list template-lambda-list
>                                              :ordinary-variable-test  
> #'valid-template-p
>                                              :optional-variable-test  
> #'valid-template-p
>                                              :key-variable-test  
> #'valid-template-p
>                                              :rest-variable-test  
> #'valid-template-p)
>
>       (let* ((n-vars (list-length vars))
>              (n-optionals (list-length optionals))
>              (env (unify (subseq a 0 (list-length vars)) vars env)))
>         (when (and optionals (>= ll (+ n-vars n-optionals)))
>           (setf env (unify (subseq a n-vars (+ n-vars n-optionals))  
> optionals env)))
>         (when (and rest (>= ll (+ n-vars n-optionals)))
>           (setf env (unify (subseq a (+ n-vars n-optionals)) (first  
> rest) env)))
>         (when keys (warn "Sorry mathcing of keywords ~S not yet  
> implemented." keys))
>         env))))
> _______________________________________________________________________ 
> __
> Mit der Gruppen-SMS von WEB.DE FreeMail können Sie eine SMS an alle
> Freunde gleichzeitig schicken:  
> http://freemail.web.de/features/?mc=021179
>
>
>
> _______________________________________________
> cl-unification-devel site list
> cl-unification-devel at common-lisp.net
> http://common-lisp.net/mailman/listinfo/cl-unification-devel
>
--
Marco Antoniotti					http://bioinformatics.nyu.edu
NYU Courant Bioinformatics Group		tel. +1 - 212 - 998 3488
715 Broadway 10th FL				fax. +1 - 212 - 998 3484
New York, NY, 10003, U.S.A.




More information about the cl-unification-devel mailing list