I am working with clojure's datomic.api. I wish to refactor a somewhat complex datalog query such as this:
(datomic.api/q '[:find [?value ...] :in $ ?uid ?component :where
[...some clause...]
[...some other clause...]
(or-join [?entitlement ?component]
(and [...some conditional stuff...])
(and [...some other conditional stuff...]))]
db uid component)
...into something more readable. My desire is to locally bind the (and...)
components of the query inside a let
and refer to them by a name inside of the datalog list. Like so:
(datomic.api/q '[:find [?value ...] :in $ ?uid ?component :where
[...some clause...]
[...some other clause...]
(or-join [?entitlement ?component]
entitled-for-component
entitled-for-application)]
db uid component)
Various quoting in let
(and unquoting inside of datomic.api/q's list) have not worked. Any suggestions?