Fork me on GitHub
#clara
<
2020-01-16
>
Matthew Pettis02:01:05

I'm having some trouble with understanding the mk-session function documentation (http://www.clara-rules.org/apidocs/0.20.0/clojure/clara.rules.html#var-mk-session). In particular, it references rule sources. Are those namespaces that the rules live in (if they aren't in the current namespace)? I'm wondering what the alternative ways there are to giving rules to a session if you don't use defrule in the current namespace. Can you construct a vector of rules (that don't have names) that you'd get from defrule and feed it to a session?

mikerod04:01:20

@matthew.pettis you can pass a collection of rules and queries

mikerod04:01:33

So a vector yes

mikerod04:01:19

If you pass an ns name it’ll be automatically expanded to a collection of all rules sources within it

mikerod04:01:34

Rule sources are defined by a protocol

mikerod04:01:08

There are a few more built in impls but those are the main 2

mikerod04:01:16

And “rule” is a bit overloaded here unfortunately since it includes queries. Clara typically calls them “productions” when referring generally to both.