Fork me on GitHub
#clara
<
2016-04-14
>
saicheong14:04:50

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

saicheong14:04:31

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

saicheong15:04:54

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

ryanbrush18:04:17

@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.

saicheong23:04:54

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)]