Skip to content

Commit 4df0dbd

Browse files
danielcomptonswannodette
authored andcommitted
CLJS-1464: Add docstrings for transducer arity
Add docstrings for the new transducer arity of interpose, distinct, and map-indexed. These docstrings match those found in Clojure.
1 parent d8a47d9 commit 4df0dbd

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/main/cljs/cljs/core.cljs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3877,7 +3877,8 @@ reduces them without incurring seq initialization"
38773877
"Returns a lazy sequence consisting of the result of applying f to 0
38783878
and the first item of coll, followed by applying f to 1 and the second
38793879
item in coll, etc, until coll is exhausted. Thus function f should
3880-
accept 2 arguments, index and item."
3880+
accept 2 arguments, index and item. Returns a stateful transducer when
3881+
no collection is provided."
38813882
([f]
38823883
(fn [rf]
38833884
(let [i (volatile! -1)]
@@ -4364,7 +4365,8 @@ reduces them without incurring seq initialization"
43644365
(concat (map first ss) (apply interleave (map rest ss))))))))
43654366

43664367
(defn interpose
4367-
"Returns a lazy seq of the elements of coll separated by sep"
4368+
"Returns a lazy seq of the elements of coll separated by sep.
4369+
Returns a stateful transducer when no collection is provided."
43684370
([sep]
43694371
(fn [rf]
43704372
(let [started (volatile! false)]
@@ -8246,7 +8248,8 @@ reduces them without incurring seq initialization"
82468248
(map #(if-let [e (find smap %)] (second e) %) coll))))
82478249

82488250
(defn distinct
8249-
"Returns a lazy sequence of the elements of coll with duplicates removed"
8251+
"Returns a lazy sequence of the elements of coll with duplicates removed.
8252+
Returns a stateful transducer when no collection is provided."
82508253
([]
82518254
(fn [rf]
82528255
(let [seen (volatile! #{})]

0 commit comments

Comments
 (0)