if I understand what you're trying to do, you will need to use method cal in the test pattern like
the catch is function-fact.func needs to return boolean true/false if you want to use it in the LHS. peter On Thu, Aug 14, 2008 at 11:23 AM, Hal Hildebrand <[EMAIL PROTECTED]> wrote: > I would like to have functions contained in the slot value of a fact and > then apply them. I can create and assign the function values by using > (lambda ...), which seems to be what I'm looking for on that side of the > equation: > (deftemplate functional-fact > (slot func) > ) > (assert (functional-fact (func (lambda (?x) (> 1 ?x))))) > However, the question becomes how do I actually call this function? What I > would like to do is use these in test CE: > (deftemplate functional-fact > (slot func) > ) > (assert (functional-fact (func (lambda (?x) (> 1 ?x))))) > (defrule test-me > (functional-fact (func ?function)) > (test (?function 0)) > => > (printout t "1 > 0" crlf)) > However, this does not work as I would expect instead failing with: > Jess reported an error in routine call > while executing (call ?function 0) > while executing 'test' CE > while executing rule LHS (TECT). > Message: No method named '0' found in class jess.Deffunction. > Program text: ( defrule test-me ( functional-fact ( func ?function ) ) ( > test ( ?function 0 ) ) = > ( printout t "1 > 0" crlf ) ) at line 11. > Clearly, I'm not understanding this and would appreciate any help from those > on the list. > Thanks. > -------------------------------------------------------------------- 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] --------------------------------------------------------------------
