Ok. This is an easy one.
Marco
On Aug 25, 2005, at 12:57 AM, norman werner wrote:
>
> it is not an unification-error.
> On sbcl it is
>
> "debugger invoked on a SB-KERNEL:BOUNDING-INDICES-BAD-ERROR in thread
> 2890:
> The bounding indices 0 and 2 are bad for a sequence of length 1."
>
> However this will almost certainly depend on the lisp used.
>
> Norman
>
> _______________________________________________________________________
> __
> 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
>
>
>
--
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.
Hello
(cl.ext.dacf.unification:unify #T(list 3 4) '(3 ))
will result in an error.
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
I wrote the last bugfix from memory only. The explanation was bullshit.
However the fix remains valid
Norman
_________________________________________________________________________
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
Hello
The match macro is (like several other macros as well ) definded as:
(defmacro match ((template object^M
&key^M
(substitution (make-empty-environment))^M
(errorp t)^M
(error-value nil))^M
&body forms)^M
..)
when one tries to write somethind like:
(dolist (template templates)
(match template form))
it will not work as expected because all invocations of match share a common environment.
A fix would be to simply quote (make-empty-environment).
Greetings
Norman Werner
_________________________________________________________________________
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