سؤال

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

هل كانت مفيدة؟

المحلول

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> 
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top