Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clips rules and functions

Tags:

clips

Hi, I have several questions:

  1. Can I modify a fact in a function in clips or can I use a fact without giving it as a parameter to the call of the function.
  2. Can I generate a random number in a rule?
  3. Can I execute a certain rule in another rule?
  4. Can I make pattern matching in functions?
like image 316
exilonX Avatar asked Nov 30 '25 22:11

exilonX


1 Answers

  1. You can modify it with (modify <fact-specifier> <RHS-slot>*)
  2. Yes, with function (random [<start-integer-expression> <end-integer-expression>]). Also commendable to set the seed before
  3. As far as i know, you can't. Rules are only fired from the agenda
  4. You can check if a fact exists with (fact-existp <fact-address-or-index>)
like image 69
Evans Avatar answered Dec 03 '25 13:12

Evans



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!