This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-11-06
Channels
- # announcements (3)
- # aws (3)
- # babashka (9)
- # beginners (87)
- # calva (3)
- # chlorine-clover (7)
- # cider (6)
- # clj-kondo (1)
- # cljs-dev (31)
- # cljsrn (7)
- # clojure (26)
- # clojure-berlin (5)
- # clojure-europe (84)
- # clojure-nl (3)
- # clojure-uk (13)
- # clojurescript (39)
- # core-async (4)
- # core-logic (3)
- # cursive (3)
- # datomic (10)
- # devcards (5)
- # duct (2)
- # emacs (3)
- # events (1)
- # fulcro (6)
- # jobs (4)
- # kaocha (12)
- # london-clojurians (1)
- # off-topic (21)
- # other-languages (2)
- # pathom (5)
- # pedestal (1)
- # re-frame (1)
- # reitit (3)
- # remote-jobs (6)
- # reveal (6)
- # sci (34)
- # shadow-cljs (99)
- # tools-deps (99)
another question. are recursive anonymous goals possible in core.logic
? i can’t get it working analogous to the regular fn
.
this workaround seems to work:
(defn packo [l1 l2]
(letfn [(transfero [a b c d]
(matche [a b c d]
([x [] [] [x]])
([x [y . ys] [y . ys] [x]] (!= x y))
([x [x . xs] ys [x . zs]] (transfero x xs ys zs))))]
(matche [l1 l2]
([[] []])
([[x . xs] [z . zs]]
(fresh [ys]
(transfero x xs ys z)
(packo ys zs))))))