Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* src/main/clojure/clojure/core/logic.clj: bounds shouldn't be in IIn…

…terval protocol. Make it a regular fn. Remove protocol implementations.
  • Loading branch information...
commit efd8002c5d4eeecb75ae6c6464974faeaa3fb171 1 parent 318bbe5
David Nolen authored
Showing with 4 additions and 5 deletions.
  1. +4 −5 src/main/clojure/clojure/core/logic.clj
View
9 src/main/clojure/clojure/core/logic.clj
@@ -201,8 +201,7 @@
(defprotocol IInterval
(lb [this])
- (ub [this])
- (bounds [this]))
+ (ub [this]))
(defprotocol IIntervals
(intervals [this]))
@@ -311,6 +310,9 @@
(declare lvar? interval multi-interval)
+(defn bounds [i]
+ (pair (lb i) (ub i)))
+
(defn interval-< [i j]
(< (ub i) (lb j)))
@@ -332,7 +334,6 @@
IInterval
(lb [_] min)
(ub [_] max)
- (bounds [_] (pair min max))
ISortedDomain
(drop-one [_]
(let [s (disj s min)
@@ -476,7 +477,6 @@
IInterval
(lb [_] _lb)
(ub [_] _ub)
- (bounds [_] (pair _lb _ub))
ISortedDomain
(drop-one [_]
(let [nlb (inc _lb)]
@@ -734,7 +734,6 @@
IInterval
(lb [_] min)
(ub [_] max)
- (bounds [_] (pair min max))
ISortedDomain
(drop-one [_]
(let [i (first is)]
Please sign in to comment.
Something went wrong with that request. Please try again.