Fork me on GitHub

I have just started learning clara. In clara-examples, the facts that are inserted into working memory are typically record type.


I wonder if 'primitive' data can also be inserted - like Strings or Keywords.


How do we write the condition expression to match a keyword or a string?


@saicheong: By default you can any type known to Clojure's type function, which includes the Java class hierarchy (including Strings, or clojure.lang.Keyword, but that's not something I've done.) If you need something more sophisticated, the link @devn posted is a good reference.


Say I have a rule that inserts a keyword :exceed-cap. Now I need to this keyword to match other rules. Will this expression in a rule match the keyword?: [clojure.lang.Keyword (= :exceed-cap)]