Below, I'm presenting a problem I ran into while setting up a demo example and explain my error. At the end, there is a question I'd like to have answered.
(deftemplate State (slot id)(slot st (type OBJECT))) ;st values from my class at.laun.ex.StatusSet (reset) ;-) (assert (State (id 1)(st (new StatusSet 1 1)))) (assert (State (id 2)(st (new StatusSet 1 1)))) (defrule match-1 (State (id 1)(st ?st)) (State (id 2)(st ?st)) => ...) (defrule match-2 (State (id 1)(st ?st1)) (State (id 2)(st ?st2 ?:(eq ?st1 ?st2))) => ...) (defrule match-3 (State (id 1)(st ?st1)) (State (id 2)(st ?st2)) (test (eq ?st1 ?st2)) => ...) According to JUM 6.12, match-2 and match-3 are "precisely eqivalent in behavior", but I managed to write the class for my State.st objects so that match-1 and match-2 fail and only match-3 delivers the correct result. I'm inserting a few empty comment lines so that you might try and guess the reason ;-) Scroll down for the answer. ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; : ; ; ; ; ; ; ; ; ; OK, I was sloppy and overrode at.laun.ex.StatusSet.equals but not at.laun.ex.StatusSet.hashCode. But the interesting question is: does this difference in behavior imply that there is some difference in efficiency between these matches? Thanks Wolfgang -------------------------------------------------------------------- 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] --------------------------------------------------------------------
