This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-18
Channels
- # announcements (6)
- # babashka (137)
- # beginners (104)
- # biff (4)
- # calva (24)
- # cider (1)
- # clj-kondo (15)
- # cljs-dev (18)
- # cljsrn (1)
- # clojure (43)
- # clojure-australia (1)
- # clojure-europe (11)
- # clojure-germany (3)
- # clojure-nl (3)
- # clojure-spec (40)
- # clojure-uk (6)
- # clojured (1)
- # clojurescript (24)
- # code-reviews (14)
- # core-logic (5)
- # cursive (24)
- # datahike (2)
- # datomic (3)
- # deps-new (9)
- # events (5)
- # figwheel-main (1)
- # fulcro (7)
- # helix (3)
- # honeysql (8)
- # jobs (4)
- # jobs-discuss (7)
- # lsp (59)
- # malli (9)
- # mid-cities-meetup (1)
- # nrepl (2)
- # off-topic (27)
- # portal (11)
- # re-frame (16)
- # reitit (1)
- # releases (12)
- # remote-jobs (4)
- # shadow-cljs (48)
- # spacemacs (1)
- # vim (9)
- # xtdb (14)
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)
...))
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
)