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.