Hi Alan,
This is the mysterious 'if you need it, you'll know' mentioned in the
documentation for the get-var function (which is functionally
identical to your getMyGlobal). A full explanation of this will, I
imagine, eventually appear in the Jess docs.
I think Alan Barton wrote:
>
> 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]
> ---------------------------------------------------------------------
>
>
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (510) 294-2154
Sandia National Labs FAX: (510) 294-2234
Org. 8920, MS 9214 [EMAIL PROTECTED]
PO Box 969 http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
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]
---------------------------------------------------------------------