Hi !

I am trying to change a fact in a mutlislot field and cannot get it to
work. Here is the relevant code:

(deftemplate contains (slot containerId) (multislot ids))

(defquery find-container
    (declare (variables ?X))
    (contains (containerId ?X) (ids $?Y)))

(deffunction xxdelete-child-from-relation-container (?FACT ?Y)
                    (bind $?multiY (create$ ?Y))
                    (bind ?rest (fact-slot-value ?FACT ids))
                    (bind ?new-ids (complement$ $?multiY ?rest))
                    (printout t "new-ids" ?new-ids))

(deffunction  yydelete-child-from-relation-container (?X ?Y)
    (bind ?obj (run-query find-container ?X))
    (bind ?tmp (call ?obj next))
    (bind ?container-obj (call ?tmp fact 1))
        (xxdelete-child-from-relation-container ?container-obj ?Y))

(bind ?x (assert (contains (containerId 1) (ids a b c))))

Now, if I call (xxdelete-child-from-relation-container ?x c) then it 
works !  Here I pass in directly a fact.

If I do (yydelete-child-from-relation-container 1 c), thereby using the
defquery, it does not work, althought ?container-obj represents the same
fact as ?x.

What's the problem ?

thanx,

Matthias

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