bounded-count

functionsince v1.9.85 clojure.core/bounded-countEdit
(bounded-count n coll)

Source docstring:
If coll is counted? returns its count, else will count at most the first n
elements of coll using its seq
Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(defn bounded-count
  {:added "1.9"}
  [n coll]
  (if (counted? coll)
    (count coll)
    (loop [i 0 s (seq coll)]
      (if (and (not (nil? s)) (< i n))
        (recur (inc i) (next s))
        i))))