Skip to content
Ryan Brush edited this page Feb 7, 2014 · 2 revisions

Clara offers ClojureScript support with a couple constraints. Because compiling the Rete network requires generating and compiling code, this action must be done on a JVM until ClojureScript is self-hosted. Therefore the ClojureScript version needs to use pre-defined rule sessions rather than generating them on the fly.

Fortunately, this is provided with the defsession macro, which ClojureScript users can simply call as follows:

(defsession my-session 'my.rule.namespace 'my.other.namespace)

where 'my-rule-namespace and others are simply symbols identifying the namespace where rules and queries are defined with defrule and defquery, respectively.

See the shopping example in clara-examples to see this in action.

Clone this wiki locally