From 75c78b94e610dbf2c8649d635c0d685b7151af24 Mon Sep 17 00:00:00 2001 From: Colin Jones Date: Mon, 12 Jul 2010 18:06:19 -0500 Subject: [PATCH] partial functions added --- src/koans/about_partial_functions.clj | 9 +++++++++ src/path_to_enlightenment.clj | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 src/koans/about_partial_functions.clj diff --git a/src/koans/about_partial_functions.clj b/src/koans/about_partial_functions.clj new file mode 100644 index 0000000..a30238b --- /dev/null +++ b/src/koans/about_partial_functions.clj @@ -0,0 +1,9 @@ +(meditations + "Partial functions allow procrastination" + (= 20 (let [multiply-by-5 (partial * 5)] + (___ __))) + + "Don't forget: first things first" + (= [__ __ __ __] + (let [ab-adder (partial concat [:a :b])] + (ab-adder [__ __])))) diff --git a/src/path_to_enlightenment.clj b/src/path_to_enlightenment.clj index 8178b6c..b8b8049 100644 --- a/src/path_to_enlightenment.clj +++ b/src/path_to_enlightenment.clj @@ -22,6 +22,7 @@ "about_conditionals" "about_higher_order_functions" "about_runtime_polymorphism" - "about_sequence_comprehensions") + "about_sequence_comprehensions" + "about_partial_functions") (println "You have achieved clojure enlightenment. Namaste.")