I think Udo Dieckmann wrote: > Makes perfect sense and I got it working. Thanks. > > Now I'm trying to bind a variable to something in the data assertion. > I'm trying to bind ?estSalesImpact to the quotient of (say) the > cw-str-cnt-small slot in "data" and the integer 2: > > (deftemplate data "the data" > (slot cw-str-cnt-small) > ... > ) > > > (bind ?estSalesImpact (/ (data (cw-str-cnt-small)) 2)) >
Depends on the context. On the LHS of a rule, you're restricted to a kind of "functional programming" style. You can bind variables to slot contents, but you can't bind one to the result of a computation. On the RHS of a rule, you'd have had to bind the value to a variable on the LHS: (defrule foo (data (cw-str-cnt-small ?c)) => (bind ?estSalesImpact (/ ?c 2)) ...) --------------------------------------------------------- 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] --------------------------------------------------------------------
