Skip to content

Instantly share code, notes, and snippets.

@WilliamParker
Created December 15, 2016 10:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WilliamParker/f0551ec2b9afb8b9e97eea0c41e0c524 to your computer and use it in GitHub Desktop.
Save WilliamParker/f0551ec2b9afb8b9e97eea0c41e0c524 to your computer and use it in GitHub Desktop.
user> (require 'clara.test-rules)
nil
user> (in-ns 'clara.test-rules)
#namespace[clara.test-rules]
clara.test-rules> (defquery query1
"Doc here"
[]
[?fact <- :a])
#'clara.test-rules/query1
clara.test-rules> (-> (mk-session [query1] :fact-type-fn :clara-fact-type)
(insert {:clara-fact-type :a :some-other-key :some-other-val})
fire-rules
(query query1))
({:?fact {:clara-fact-type :a, :some-other-key :some-other-val}})
clara.test-rules> (-> (mk-session [query1])
(insert {:clara-fact-type :a :some-other-key :some-other-val})
fire-rules
(query query1))
()
clara.test-rules>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment