Clojurians
#precept
<
2018-03-23
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

amarjeet14:03:23

Hey @alex-dixon, wanted to check with you before I experiment. The use-case is that I want to generate rules at the compile time (say, via Macros). Precept consumes namespace to create the session, which is different from Clara where I can provide just rules to create a session. So, does it mean that I will have to create a namespace as well at the compile time that can be fed to the session? Or, do you see other possible ways of handling such scenarios?

alex-dixon17:03:56

@amarjeet Hey. Clojure or Clojurescript?

amarjeet17:03:15

clojurescript

alex-dixon17:03:53

OK. Could you explain more? You want to generate rules dynamically at runtime, or just at compile time? Right now they are compile time

amarjeet17:03:13

compile time only. Its like I take some input/data, and apply macros to spit out rules at the compile time

alex-dixon17:03:49

Ok. It would be namespaced base and that namespace would need to be required in the session along with other rule namespaces

alex-dixon17:03:20

I’m not sure if before Clara 0.17 there was support for loading rules without namespaces in CLJS, just Clojure. I’d recommend looking into that feature though — they did a lot of work on it and extended the API. I think it would help your exact use case

amarjeet17:03:04

hmm, i had thought so on the first point. On the 2nd point - will have to check. I had used just rules to build session in Clojure only. Haven't tried vanila Clara in cljs. In cljs, I am riding on Precept :slightly_smiling_face:

amarjeet17:03:42

Will explore this more

amarjeet17:03:44

thanks :slightly_smiling_face:

alex-dixon17:03:46

Awesome. Thanks for saying hey :simple_smile: