I can only point you to an example for your 2nd question, using a
similar usage context (works in both clj/cljs):
https://github.com/thi-ng/fabric/blob/master/fabric-facts/src/dsl.org#examples
Implementation details:
Datomic allows clojure.core fns to be embedded inside datalog queries,
except eval (http://docs.datomic.com/query.html)
1. Do we know how secure is this - what if the datalog comes from untrusted
user input?
2. What is the best way to implement restricted-eval like this on jvm,
compared to