Permalink
Browse files

fix unification on relations

  • Loading branch information...
1 parent 19e592e commit d00d58685764a68d4e7c6d8294ac200786c83a7e @orb orb committed with swannodette Jun 26, 2013
Showing with 8 additions and 1 deletion.
  1. +1 −1 src/main/clojure/clojure/core/logic.clj
  2. +7 −0 src/test/clojure/clojure/core/logic/tests.clj
@@ -1879,7 +1879,7 @@
(to-stream
(->> set#
(map (fn [cand#]
- (when-let [~'a (clojure.core.logic/unify ~'a [~@as] cand#)]
+ (when-let [~'a ((== [~@as] cand#) ~'a)]
~'a)))))))))))))
;; TODO: Should probably happen in a transaction
@@ -1160,6 +1160,13 @@
(== [e a v] out)))
'())))
+(deftest test-to-stream
+ ;; LOGIC-139
+ (let [answers
+ (run* [q] (fresh [x] (!= x 'Bob) (man x)))]
+ (is (= 2 (count answers)))
+ (is (every? symbol? answers))))
+
;; -----------------------------------------------------------------------------
;; nil in collection

0 comments on commit d00d586

Please sign in to comment.