summaryrefslogtreecommitdiff
path: root/src/clj
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2009-02-11 02:53:36 +0000
committerRich Hickey <richhickey@gmail.com>2009-02-11 02:53:36 +0000
commitf5ebf8fee9420b79cca1f74a7f2cd7d9cb7ca7ad (patch)
tree0de69b94ac4ac3ce3c80837fcf0a707f5e32eec9 /src/clj
parentfdd42d25f842b610f3eaacb117b3223743a7fb08 (diff)
added Counted interface and counted? predicate
implement stack/heap safe count in RT stack-safe count in ASeq/Cons, patch from Chouser
Diffstat (limited to 'src/clj')
-rw-r--r--src/clj/clojure/core.clj4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj
index e68f7c3b..09ff3acb 100644
--- a/src/clj/clojure/core.clj
+++ b/src/clj/clojure/core.clj
@@ -3713,6 +3713,10 @@
"Returns true if coll implements Sorted"
[coll] (instance? clojure.lang.Sorted coll))
+(defn counted?
+ "Returns true if coll implements count in constant time"
+ [coll] (instance? clojure.lang.Counted coll))
+
(defn reversible?
"Returns true if coll implements Reversible"
[coll] (instance? clojure.lang.Reversible coll))