, the Rule Engine for the JavaTM
|Cant Bind To Slot If Pattern Contains Not
This example is derived from a recent post to the Jess list server. - JM
(foo (x ?x))
(not (bar (y ?x) (z ?z))
(printout t "z =" ?z crlf))
Seems harmless enough. Two facts that share one slot value. If we match that, we print a slot value from the second fact.
Jess rightly reports an error in the printout because the "not" CE checks for the absence of a fact. You cannot bind to a fact's slots if the fact is not present in working memory. Thus, the reference to ?z generates a runtime error.
CommonBeginnerMistakes | CannotGetThereFromHere
Front Page |
Recent Changes |
Powered by Friki |
Last Edited: 18 August 2006