Fork me on GitHub
#core-logic
<
2017-08-22
>
zilti11:08:27

How can I execute a core.logic goal repeatedly until exhausted, and use the result as a list in my logic program? I'm looking for the equivalent to "nesting" a run expression, so to speak.

zilti13:08:42

Basically what I have now is:

(defn next-free-license [ltype]
  (run 1 [q]
       (fresh [licid tid link links license]
              (datascript= [tid :type/name ltype])
              (datascript= [licid :license/type tid])
              (datascript= [licid :license/key license])
              (datascript= [licid :license/user link])
              (membero link links)
              (== q [links licid license]))))
Which gets me [(138 . _0) 6 "532f16c2c9b13540eb6a"] but I need [(138 143 151 153) 6 "532f16c2c9b13540eb6a"]