Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Side-narrowing: why didn't I thought of it before?

  • Loading branch information...
commit aa7c7ca4b55554ee6562ab139bdc69b9e516f62c 1 parent 2e80292
@cgrand cgrand authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/main/clojure/clojure/core/logic.clj
View
4 src/main/clojure/clojure/core/logic.clj
@@ -809,7 +809,9 @@
(defn join
"Returns the intersection of two Searches"
[a b]
- (and a b (Join. a b (+ (sizehint a) (sizehint b)))))
+ ; if a or b is nil then the narrowed a will be nil
+ (when-let [a (narrow a (min-yield b))]
+ (Join. a b (+ (sizehint a) (sizehint b)))))
(deftype Narrow [a ss]
Search
Please sign in to comment.
Something went wrong with that request. Please try again.