Re: JESS: functions as values and calling them

2008-08-25 Thread Hal Hildebrand
Yea, asserting before defining the rule definitely has a tendency to make things confusing... On Aug 24, 2008, at 8:42 PM, Jason Morris wrote: Hi Hal, Clean up your code a bit, and I think it works fine. :-) ; hal.clp (clear) (watch all) (deftemplate functional-fact (slot func))

JESS: functions as values and calling them

2008-08-24 Thread Hal Hildebrand
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

Re: JESS: functions as values and calling them

2008-08-24 Thread Peter Lin
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

Re: JESS: functions as values and calling them

2008-08-24 Thread Jason Morris
Hi Hal, Clean up your code a bit, and I think it works fine. :-) ; hal.clp (clear) (watch all) (deftemplate functional-fact (slot func)) (defrule test-me (functional-fact (func ?function)) (test (?function 0)) = (printout t 1 0 crlf)) ; PROGRAM (reset) (assert