Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix unification on relations
  • Loading branch information
orb authored and swannodette committed Jul 4, 2013
1 parent 19e592e commit d00d586
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/clojure/clojure/core/logic.clj
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions src/test/clojure/clojure/core/logic/tests.clj
Expand Up @@ -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

Expand Down

0 comments on commit d00d586

Please sign in to comment.