Skip to content

Instantly share code, notes, and snippets.

@geraldodev
Created December 31, 2019 19:27
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 geraldodev/076ccb995db907644070f134656fb74b to your computer and use it in GitHub Desktop.
Save geraldodev/076ccb995db907644070f134656fb74b to your computer and use it in GitHub Desktop.
:fact-type-fn does not appear to stick with defsession.
(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