Fork me on GitHub
#clara
<
2019-04-27
>
Joel04:04:55

I want to have multiple rule systems, each would have it's own namespace, but I'd like to share not only records, but defquerys as well. However, I'm not figuring out how to add the defquery from another namespace.

mikerod17:04:26

@joel380 you can pass ns names, or a collection of rule/query structures to mk -session

mikerod17:04:30

So if you did defquery, you’d just do:

(mk-session [my-query])

👍 4
mikerod17:04:34

There is more you can do too if you mark a var metadata with :production-seq that allows you to store sequences of rule/query structures under a single var when a ns is searched for rules/queries.

Joel23:04:44

thanks, i had tried (mk-session '(my-query)) ... still getting up to speed on clojure

Joel23:04:47

hopefully that let's me use another ns as well. ill give it a go.

wparker09:04:40

Yes, you can use an arbitrary mix of namespaces and sequences of explicitly included rules/queries when defining your session.