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
On Aug 24, 2005, at 3:20 PM, norman werner wrote:
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))
Are you actually trying to to
(dolist (template templates) (match (template <some-object>) form))
?
This is not the intended use to the form, as the TEMPLATE variable will appear literally in the call to UNIFY.
You will have to use UNIFY directly to achieve what you want.
Maybe a useful macro would be
(with-substitution-variables (v1 v2 ... vN) <substitution> <form>*)
Then you could write
(dolist (template templates) (with-substitution-variables (v1 v2 ... vN) (unify template object) <form>))
Cheers
-- 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.
cl-unification-devel@common-lisp.net