Question

Is there any way in Clips to create a rule in which the RHS is a Function call?

Was it helpful?

Solution

Yes:

CLIPS> (deffunction foo()
         (printout t "The function was called." crlf))
CLIPS> (defrule calls-function
         (trigger)
       =>
         (foo)
       )
CLIPS> (reset)
CLIPS> (assert (trigger))
<Fact-1>
CLIPS> (run)
The function was called.
CLIPS> 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top