Re: JESS: addSlot without any default value
"Ernest Friedman-Hill" <[email protected]>
| Newsgroups | gmane.comp.java.jess |
|---|---|
| Message-ID | <[email protected]> |
Every slot always has a default value. Slots aren't like entries in a
map, that either exist or not; slots are like member variables in a
Java class: they always have some value associated with them. If you
have slots you want to store numbers in, then set the default to a
number like new Value(0, RU.INTEGER).
On Oct 2, 2010, at 7:13 PM, Santiago Almirón wrote:
>
> Hello,
> First, excuse me for my English. My native languaje is Spanish.
> I am writing to you because I have a little problem with Jess's API,
> especially with addSlot from Class Deftemplate. I do not know how I
> add a new slot without any default value. The main problem is with
> FLOAT and INTEGER types. Because, some Facts which I work do not
> have this slot instanced. If a give a default value, some rules will
> be fired . I usually add SYMBOL slots in this way:
>
> addSlot("Name", Funcall.NIL, "SYMBOL");
>
> And then, when I assert a new Fact, a (Name nil) appears if I do not
> give any value. SYMBOL type is not a problem, but FLOAT and INTEGER
> types is a problem for me.
>
> I appreciate your time. Thanks in advance.
> Best regards
>
> Santiago
>
>
>
>
> --------------------------------------------------------------------
> 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]
> .
> --------------------------------------------------------------------
---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences, Sandia National Laboratories
PO Box 969, MS 9012, Livermore, CA 94550
http://www.jessrules.com
--------------------------------------------------------------------
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].
--------------------------------------------------------------------