I think Alexander Lamb wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> > You really only mean this rule to apply when selectedScript is nil, so
> > you should state that explicitly:
> > 
> > (defrule ASP1
> >    (OrmedContext
> >        (readyToRun TRUE)
> >        (task "script")
> >        (selectedScript nil)
> >        (OBJECT ?c)
> >    )
> >     ...
> > 
> > When the rule fires, selectedScript becomes non-nil, and the rule
> > won't be reactivated.
> 
> I had thought about that but didn't you say bean properties can't be nil?
> 

My recollection is that the JavaBeans spec says this; if it doesn't,
in any event, it's an assumption made by many JavaBeans containers. As
a result, it's bad practive to write Beans that can return null from
their getX methods. Nevertheless, sometimes it's unavoidable.

Jess does *not* make this assumption, per se; but if you
test the value in a slot, Jess won't test for null first -- you have
to do it yourself; i.e., Jess assumes that if you compare the value of
a slot to another value, then the slot held a value, not a null.

In any event, it's definitely OK to test against nil this way.

---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9012                  [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
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to