Skip to content

Commit fa7c692

Browse files
thomasmulvaneydnolen
authored andcommitted
CLJS-1951: Missing 0 and 1 arity versions of interleave
1 parent be76830 commit fa7c692

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/main/cljs/cljs/core.cljs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4656,6 +4656,8 @@ reduces them without incurring seq initialization"
46564656

46574657
(defn interleave
46584658
"Returns a lazy seq of the first item in each coll, then the second etc."
4659+
([] ())
4660+
([c1] (lazy-seq c1))
46594661
([c1 c2]
46604662
(lazy-seq
46614663
(let [s1 (seq c1) s2 (seq c2)]

src/test/cljs/cljs/collections_test.cljs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,3 +615,7 @@
615615
(deftest test-cljs-1809
616616
(is (= (into) []))
617617
(is (= (into [1 2]) [1 2])))
618+
619+
(deftest test-cljs-1951
620+
(is (= () (interleave)))
621+
(is (= '(1 2 3) (interleave [1 2 3]))))

0 commit comments

Comments
 (0)