Hello. I was able to write some code that illustrates the
(definstance) problem in Jess 41b4. After loading and invoking (run),
the following form will cause (definstance) to return FALSE:
(definstance rocky (bag get (bag find rockies) rocky))
Thanks.
;;
;; Jess code from file 'schtum.clp'...
;;
(defclass rocky Rocky)
(deffunction register-instance ()
(bind ?obj (new Rocky))
(bind ?bag (bag create rockies))
(bag set ?bag rocky ?obj)
(definstance rocky ?obj))
(defrule schtum
=>
(register-instance))
(defrule match
(rocky)
=>
(printout t "found rocky" crlf))
(defrule cleanup
(declare (salience -50))
?fact <- (rocky)
=>
(retract ?fact))
(defrule halt
(declare (salience -1000))
?fact <- (initial-fact)
=>
(retract ?fact)
(assert (initial-fact))
(halt))
;;
;; Class code for Rocky...
;;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
public final class Rocky {
public void addPropertyChangeListener(PropertyChangeListener pcl)
{
}
public void removePropertyChangeListener(PropertyChangeListener pcl)
{
}
}
--
-------------------------------------------------------------
David E. Young
Fujitsu Network Communications "I claim not to have controlled
([EMAIL PROTECTED]) events, but confess plainly
that events have controlled me."
-- Abraham Lincoln (1864)
"Apology is Policy"
---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list. List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------