Indeed. This is a bug in the special-case handling for defglobals on
rule LHSs. I'll make sure to get this right in the next release. For
now, you might have to just avoid referring to a defglobal more than
once on any given rule LHS. You could push the test down to the RHS,
or you could move the defglobal into a fact. Thanks for the report.

I think Jacek Gwizdka wrote:
> 
> Hi Jess Users!
> 
> I am seeing a strange error in the following test CE :
> 
> a) Works OKAY:
> (test (eq  (call ?*object* getValue) (get-member ?*constants* CONST_1)) )
> 
> b)  Gives NullPointer ERROR:
> (test (or (eq  (call ?*object* getValue) (get-member ?*constants* CONST_1))
> 
>         (eq  (call ?*object* getValue) (get-member ?*constants* CONST_2))))
> 
> 
> 
> All variables have the same values in both cases.
> I stepped through Jess (using 5.0a4 )code to the line where it fails:
> 
> jess\Funcall.java:
> 
> class ExtractGlobal implements Userfunction, Serializable {
> ....
>  public Value call(ValueVector vv, Context context)        throws
> ReteException
>   {
>     return context.findBinding(vv.get(1).stringValue()).m_val;
> <================
>   }
> }
> 
> 
> in jess\Context.java:
> 
>   Binding findBinding(String key)
>   {
>     Context c = this;
>     while (c != null)
>       {
>         Binding b = (Binding) c.getBindings().get(key);
>         if (b != null)
>           return b;
>         else
>           c = c.m_parent;      <=====  NULL ????
>       }
>     return null;
>   }
> 
> When, in the case b),  it is trying to find bindings for ?*object*  second
> time around in the while loop c is null,  whereas in the case a) it is
> getting the correct value. Any ideas what the problem might be?
> 
> Thanks,
> -- Jacek
> 
> 
> 
> ---------------------------------------------------------------------
> 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: (925) 294-2154
Sandia National Labs                FAX:   (925) 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]
---------------------------------------------------------------------

Reply via email to