On Mar 28, 2007, at 3:15 PM, Nils Boesch wrote:


(defquery search (declare (variables ?in)) (A (b ?out)) (contains ? in ?out))
(bind ?result (run-query* search (list d e)))
(while (?result next) (printout t (?result getString a)))

This query isn't written correctly; you can't use a plain function call in the middle of a query any more than you can use one in the middle of the LHS of a rule. You mean something like

(defquery search (declare (variables ?in)) (A (b ?out&:(contains ?in ? out))))

or

(defquery search (declare (variables ?in)) (A (b ?out) (test (contains ?in ?out)))


(defquery search2 (declare (variables ?in)) (A (b ?in)))
(bind ?result (run-query* search2 (list d e f g)))
(while (?result next) (printout t (?result getString a)))


This one also won't work; it would match if the multislot b held a single item which was a list identical to the parameter. Your first version is a fine way to do what you want.

---------------------------------------------------------
Ernest Friedman-Hill
Advanced Software Research          Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550                 http://www.jessrules.com

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to