summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2010-05-01 15:04:02 -0400
committerRich Hickey <richhickey@gmail.com>2010-05-01 15:04:02 -0400
commit7b4b8e18c0d28e03e7c66f54bc441ef355ceb5ed (patch)
treeb0e4bae2d2821869661b3786a842d8a13e3b1d9e
parent423e0b7c7d38fc5eb759829c3b38965c2784ab65 (diff)
removed seq-contains?
-rw-r--r--src/clj/clojure/core.clj11
-rw-r--r--test/clojure/test_clojure/sequences.clj4
2 files changed, 1 insertions, 14 deletions
diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj
index df319026..6b0fbbbf 100644
--- a/src/clj/clojure/core.clj
+++ b/src/clj/clojure/core.clj
@@ -1017,8 +1017,7 @@
returns false. Note that for numerically indexed collections like
vectors and Java arrays, this tests if the numeric key is within the
range of indexes. 'contains?' operates constant or logarithmic time;
- it will not perform a linear search for a value. See also
- 'seq-contains?' and 'some'."
+ it will not perform a linear search for a value. See also 'some'."
[coll key] (. clojure.lang.RT (contains coll key)))
(defn get
@@ -5115,14 +5114,6 @@
[coll]
(nth coll (rand-int (count coll))))
-(defn seq-contains?
- "Returns true if sequential search of coll contains something equal (with =) to x,
- in linear time."
- {:added "1.2"}
- [coll x]
- (if (some (fn [y] (= y x)) coll)
- true false))
-
(defn partition-all
"Returns a lazy sequence of lists like partition, but may include
partitions with fewer than n items at the end."
diff --git a/test/clojure/test_clojure/sequences.clj b/test/clojure/test_clojure/sequences.clj
index 5c71e174..a8db5cb5 100644
--- a/test/clojure/test_clojure/sequences.clj
+++ b/test/clojure/test_clojure/sequences.clj
@@ -1147,10 +1147,6 @@
(let [elt (rand-nth [:a :b :c :d])]
(is (#{:a :b :c :d} elt))))
-(deftest test-seq-contains?
- (is (seq-contains? [1 2 3 4 5] 5))
- (is (not (seq-contains? [1 2 3 4 5] 6))))
-
(deftest test-partition-all
(is (= (partition-all 4 [1 2 3 4 5 6 7 8 9])
[[1 2 3 4] [5 6 7 8] [9]]))