Created
January 20, 2023 19:05
-
-
Save yvern/70913708987aef7efd1d99d93826ca74 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns yvern.test-rules | |
(:require [clara.rules :refer [defrule insert!]] | |
[yvern.defrule :as check])) | |
(check/defrule | |
(defrule ok | |
[:a] | |
=> | |
(insert! {:fact-type :b}))) | |
(check/defrule | |
(defrule also-ok | |
[:a] | |
=> | |
(let [b :b] | |
(insert! {:fact-type b})))) | |
(check/defrule | |
(defrule not-ok | |
[:a] | |
=> | |
(when (< 0.5 (rand)) | |
(insert! {:fact-type :b})))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment