Created
December 31, 2019 19:27
-
-
Save geraldodev/076ccb995db907644070f134656fb74b to your computer and use it in GitHub Desktop.
:fact-type-fn does not appear to stick with defsession.
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 app.mv.clara2 | |
(:require | |
[clara.rules :refer :all] | |
[clara.tools.inspect :as inspect] | |
) | |
) | |
(defsession session :fact-type-fn :type) | |
(defquery a-query | |
[] | |
[?fact <- :fact]) | |
;; I have the impression that :fact-type-fn does not stick with the session | |
(defn this-should-show-activations-but-it-doesnt | |
[] | |
(-> session | |
(insert {:type :fact :foo :bar}) | |
(fire-rules) | |
(inspect/explain-activations) | |
) | |
) | |
(defn this-shows-activations | |
[] | |
(-> (mk-session :fact-type-fn :type) | |
(insert {:type :fact :foo :bar}) | |
(fire-rules) | |
(inspect/explain-activations) | |
) | |
) | |
(comment | |
(this-should-show-activations-but-it-doesnt) | |
(this-shows-activations) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment