I think Michael Beaulieu wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> I'm brand new to Jess and I was wondering if there was already a
> function available to facilitate the matching of a slot value being in a
> list of valid values
>
> (deftemplate bla
> (slot data) )
>
> (defrule foobar
> (bla (data (in ('foo','bar') ) ) )
You can just write
(bla (data foo | bar | baz ))
Which will match if the data slot contains any of the given three values.
If the list were very long (long enough that it would be hard to read
if written this way) then you should write a trivial deffunction to
check if the value is a member of a Java HashSet, then call that
function (creating the HashSet once and storing it in a defglobal or
someplace.)
---------------------------------------------------------
Ernest Friedman-Hill
Science and Engineering PSEs Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://herzberg.ca.sandia.gov
--------------------------------------------------------------------
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]
--------------------------------------------------------------------