From 36b98d01205e952467a5474f3e8b0c610ecbb1b9 Mon Sep 17 00:00:00 2001 From: Marshall Shen Date: Fri, 26 Jul 2013 20:34:21 -0500 Subject: [PATCH] add more exercise --- resources/koans.clj | 1 + src/koans/08_higher_order_functions.clj | 3 +++ 2 files changed, 4 insertions(+) diff --git a/resources/koans.clj b/resources/koans.clj index c1c6e93..9b3e8a2 100644 --- a/resources/koans.clj +++ b/resources/koans.clj @@ -83,6 +83,7 @@ () [:anything :goes :here] (< x 31) + [2 4 6 8] (* 10 x) (< x 4) 24 100 diff --git a/src/koans/08_higher_order_functions.clj b/src/koans/08_higher_order_functions.clj index 0d53b94..cc5eba8 100644 --- a/src/koans/08_higher_order_functions.clj +++ b/src/koans/08_higher_order_functions.clj @@ -17,6 +17,9 @@ "Or somewhere in between" (= [10 20 30] (filter (fn [x] __) [10 20 30 40 50 60 70 80])) + "It all depends on what you want, you can also use a prefined function" + (= __ (filter even? [1 2 3 4 5 6 7 8])) + "Maps and filters may be combined" (= [10 20 30] (map (fn [x] __) (filter (fn [x] __) [1 2 3 4 5 6 7 8])))