From 7974120ec393f84a9180560a0cfa03429a00712c Mon Sep 17 00:00:00 2001 From: Colin Jones Date: Mon, 9 Oct 2017 13:16:10 -0500 Subject: [PATCH] Use an explicit function argument for `iterate` Also replace :hello with "hello" to avoid potential confusion since :hello is also a function. refs #75 --- resources/koans.clj | 2 +- src/koans/11_lazy_sequences.clj | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/koans.clj b/resources/koans.clj index f8ab268..a63ec62 100644 --- a/resources/koans.clj +++ b/resources/koans.clj @@ -127,7 +127,7 @@ [0 1 2 3 4] 10 95 - (range 20) + [1 2 4 8 16 32 64 128] :a] "___" [(fn [x] x)]}] diff --git a/src/koans/11_lazy_sequences.clj b/src/koans/11_lazy_sequences.clj index 1023785..5144361 100644 --- a/src/koans/11_lazy_sequences.clj +++ b/src/koans/11_lazy_sequences.clj @@ -17,12 +17,12 @@ (drop __ (range 100))) "Iteration provides an infinite lazy sequence" - (= __ (take 20 (iterate inc 0))) + (= __ (take 8 (iterate (fn [x] (* x 2)) 1))) "Repetition is key" (= [:a :a :a :a :a :a :a :a :a :a] (repeat 10 __)) "Iteration can be used for repetition" - (= (repeat 100 :hello) - (take 100 (iterate ___ :hello)))) + (= (repeat 100 "hello") + (take 100 (iterate ___ "hello"))))