Skip to content

0.11.0

Compare
Choose a tag to compare
@oakes oakes released this 19 Jun 19:19
· 33 commits to master since this release

This release adds a new function, odoyle.rules/contains?, to check if a fact is in the session. This is useful when you want to insert a fact if and only if it isn't already in the session. You can even use it within a rule, like this:

[:what
 [id ::score score]
 :when
 (>= score 5)
 :then
 (when-not (o/contains? o/*session* ::event ::game-finished)
   (o/insert! ::event ::game-finished {:winner id}))]

I also fixed a small bug with the new ->rule function that allows you to create rules dynamically. Using {:then not=} in a dynamic rule no longer throws a spec error.