在剪辑中调用RHS规则中的函数

时间:2013-09-16 15:52:16

标签: function clips

Clips中是否有任何方法可以创建 RHS 是函数调用的规则?

1 个答案:

答案 0 :(得分:1)

是:

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>