1.3.0 permalink 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:5503 top

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

Comments top

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