Fork me on GitHub

Is there a way to get all potential values for a logic var in a list? So basically a way to run this in one step? I feel like that should be obvious, but I don't see it

(let [result (run* [q] ...)]
  (run* [q]
    (membero q result)


(there might be other constraints that need to access the value of result )


Related question: Is it possible to build prologs findall? That would provide a different way to solve the problem... I have this so far:

(defna findall [pred col result]
  ([_ [] []])
  ([_ [?x . ?rc] [?x . ?rr]]
   (pred ?x)
   (findall pred ?rc ?rr))
  ([_ [_ . ?rc] _]
   (findall pred ?rc result)))
but it's not relational, and I'm not sure it works as I would expect in all cases. (Would pass it something built with fne as pred )