You're viewing version 1.2.0 of counted?. The latest stable version of Clojure Core is 1.3.0.
1.2.0 Arrow_down_16x16

counted?

clojure.core

  • (counted? coll)
Returns true if coll implements count in constant time

1 Example top

  • user=> (counted? [:a :b :c])
    true
    
    user=> (counted? '(:a :b :c))
    true
    
    user=> (counted? {:a 1 :b 2 :c 3})
    true
    
    user=> (counted? #{:a :b :c})
    true
    
    user=> (counted? "asdf")
    false
    
    user=> (counted? (into-array Integer/TYPE [1 2 3]))
    false
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/core.clj:5010 top

(defn counted?
 "Returns true if coll implements count in constant time"
 {:added "1.0"}
  [coll] (instance? clojure.lang.Counted coll))
Vars in clojure.core/counted?: defn instance?
Used in 0 other vars

Comments top

No comments for counted?. Log in to add a comment.