On Mar 28, 2007, at 4:46 PM, Nils Boesch wrote:

Ernest Friedman-Hill wrote:

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


For both versions I get the following result:

Jess> (bind ?result (run-query* search (list d e f)))
<Java-Object:jess.QueryResult>
Jess> (while (?result next) (printout t (?result getString a)))
FALSE


Sorry; when I corrected your function problem, I neglected to correct another problem: the above query matches the multislot "b" with the single variable ?out, which is only going to match when "b" contains just one element. You want to use a multifield $?out there instead of ?out, so that the variable matches the entire contents of the multislot; then your query will work fine. So just adding the single "$" character:

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

---------------------------------------------------------
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