I have come across the following behaviour that may be of interest
to others...

(defglobal ?*myGlobal* = 0)

(deftemplate item
        (slot id)
)

(defrule myRule1
        ?f <- (performRule)
=>
        (retract ?f)
        (build "(defrule myRule2
                        ?f <- (item (id ?id&:(< ?id 10)) )    ; Note this line...
                    =>
                        (retract ?f)
                    )")
)

If I try
?f <- (item (id ?id&:(< ?id ?*myGlobal*)) )
on the noted line, at runtime, JESS complains of the fact that ?*myGlobal* is not
bound. However, if I instead use the following line
?f <- (item (id ?id&:(< ?id (getMyGlobal))) )
and define

(deffunction getMyGlobal ()
        (return ?*myGlobal*)
)

Then everything works fine!

Alan.

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

Reply via email to