This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-14
Channels
- # beginners (4)
- # boot (2)
- # cider (17)
- # clara (8)
- # cljs-dev (5)
- # clojure (16)
- # clojure-italy (14)
- # clojure-nl (1)
- # clojure-norway (1)
- # clojure-russia (1)
- # clojure-uk (4)
- # clojurescript (8)
- # data-science (19)
- # datomic (4)
- # ethereum (1)
- # events (1)
- # fulcro (15)
- # graphql (4)
- # hoplon (10)
- # jobs (1)
- # mount (1)
- # off-topic (15)
- # parinfer (4)
- # perun (1)
- # portkey (6)
- # re-frame (15)
- # reagent (10)
- # schema (1)
- # shadow-cljs (80)
- # specter (4)
- # test-check (35)
@mmer no. Clara allows for you to provide your own :fact-type-fn
, for arbitrary “type dispatch”, as well as :ancestors-fn
for setting up “type hierarchies”. This is all in much the same was as Clojure’s ad hoc hierarchies work via derive
and isa?
etc
(r/defrule my-rule
[:my-fact-type (= (:x this) ?x)]
=>
(println "hello"))
(-> (r/mk-session [my-rule])
(r/insert (with-meta {:x 10} {:type :my-fact-type}))
r/fire-rules)
Here are some docs on it http://www.clara-rules.org/docs/fact_type_customization/