This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-16
Channels
- # announcements (5)
- # asami (4)
- # babashka (72)
- # beginners (241)
- # calva (15)
- # cider (2)
- # circleci (5)
- # clara (41)
- # clj-kondo (38)
- # cljsrn (4)
- # clojars (33)
- # clojure (283)
- # clojure-europe (41)
- # clojure-nl (9)
- # clojure-uk (11)
- # clojuredesign-podcast (14)
- # clojurescript (76)
- # conjure (12)
- # cryogen (42)
- # data-science (1)
- # datalog (6)
- # datomic (7)
- # depstar (10)
- # events (2)
- # figwheel-main (1)
- # fulcro (22)
- # funcool (1)
- # london-clojurians (1)
- # malli (8)
- # meander (11)
- # off-topic (12)
- # pathom (19)
- # re-frame (8)
- # reveal (34)
- # shadow-cljs (34)
- # sql (7)
- # vim (8)
- # xtdb (6)
Is there a way to create rules without the defrule
macro? I am currently pulling constraints out of a database and would like to make a bunch of rules based off of those. I noticed that the macro appears to just create a var?
(def
do-it
{:ns-name 'woof,
:lhs '[{:type woof.Person, :constraints [(= name "me")]}],
:rhs '(do (prn "99999")),
:name "woof/do-it"})
However creating that var does not seem to create the rule.if you do use vars, the question then becomes how is it “auto detected” via Clara’s default namespace scanning impl
https://github.com/cerner/clara-rules/blob/0.21.0/src/main/clojure/clara/rules.cljc#L271-L305
@mikerod I would use vars or not. It just feels better than using a macro to generate defrules
https://github.com/cerner/clara-rules/blob/0.21.0/src/test/clojure/clara/test_rules.clj#L144
you see they are almost all just based on passing rule/query maps in a collection to mk-session
which works better for cases where you are more statically writing rules via macros/DSL
I looked briefly on http://clara-rules.org and do not see any actual good documentation around “rule sources”