1
私は次のコード例では[[:a :A] [:b :B] [:c :C]]
から[:b :B]
を削除したいない、と私は(lvar)
で:B
を交換した場合、それはもはや作品:Clojure core.logicの[:a:A] [:b:B] [:c:C]]から[:b(lvar)]を削除するにはどうしたらいいですか?
;; Helper Function
(defne not-membero [x l]
([_ []])
([_ [?y . ?r]]
(!= x ?y)
(not-membero x ?r)))
これらの作業:
(run* [q]
(membero q [[:a :A] [:b :B] [:c :C]])
(not-membero q [[:b :B]]))
(run* [q]
(membero q [[:a :A] [:b :B] [:c :C]])
(!= q [:b :B]))
;; both return [[:a :A] [:c :C]], as expected
これらの(ないの通知lvar
):これは「doesnの
(run* [q]
(membero q [[:a :A] [:b :B] [:c :C]])
(not-membero q [[:b (lvar)]]))
(run* [q]
(membero q [[:a :A] [:b :B] [:c :C]])
(!= q [:b (lvar)]))
;; both return [[:a :A] [:b :B] [:c :C]], unexpected