Fork me on GitHub

hello, I been fiddling around and im stuck at this right now:


(insert! (->Person)))


you're calling the positional constructor for Person


it requires two arguments, name and age


you're only giving one


Caused by: clojure.lang.ArityException: Wrong number of args (0) passed to: core/eval6101/->Person--6116


@ragge: what I want is to add that record when the rule is true


I thought I was accomplishing that in that manner


do I need to pass the params in?


another thing is that for some reason age the (>= 21 age) is not working if I set the age on the session to 21


@datajohnny That test rule matches a person when the age is >= 21, so it is only true if such a person has already been inserted. The right-hand side of the rule is just a Clojure s-expression that can insert additional facts derived from what matched. So typically you would insert the person (as that example does), match on age >=21, and insert a new fact if that's the case (like a PersonIsAdult fact).


@datajohnny: If you want to get an idea of general usage patterns, I'd check out the examples at


@ryanbrush: can the rules work with just maps instead of records, I am trying to build kinda like the same thing you had in your latest blog post but instead of grammar I am getting a json payload


@datajohnny: It can use records. You'll need to provide a function that returns a "type" for map you use, which will match the type of the rule. See the fact-type-fn at There's also a unit test that shows some usage of it at The test generates rules in place but you can see a provided fact-type-fn that just reads a field from a record in action.