On Nov 13, 2006, at 1:22 AM, Soil inf. wrote:
"it is better practice to explicitly define an unordered fact
template with a
multislot to hold the list."
I am using an unordered template with multislots and return "not a
number"
error when i try to add / subtract multislot values. Sorry for such
a basic
question but how do i handle the multislot values so that i can
manipulate
them as numbers.
You haven't shown us what you're doing, so I can't say what you're
doing wrong, but the following example works, so it might help you
figure this out on your own:
(deftemplate numbers (multislot values))
(defrule add-two-numbers
"Match numbers/values slots with exactly two entries and add the
values"
(numbers (values ?a ?b))
=>
(printout t "The sum is " (+ ?a ?b) crlf))
---------------------------------------------------------
Ernest Friedman-Hill
Advanced Software Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
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]
--------------------------------------------------------------------