From b340cb6ccb3f8b0bb100ca809b020e1df19ba2f3 Mon Sep 17 00:00:00 2001 From: Colin Jones Date: Fri, 5 Nov 2010 17:33:06 -0500 Subject: [PATCH] Multiple-argument #() syntax. --- src/koans/functions.clj | 3 +++ src/path_to_answer_sheet.clj | 1 + 2 files changed, 4 insertions(+) diff --git a/src/koans/functions.clj b/src/koans/functions.clj index fcc51d9..39ef8cb 100644 --- a/src/koans/functions.clj +++ b/src/koans/functions.clj @@ -13,6 +13,9 @@ "Or using even shorter syntax" (= __ (#(* 15 %) __)) + "Short anonymous functions may take multiple arguments" + (= __ (#(+ %1 %2 %3) 4 5 6)) + "One function can beget another" (= __ ((fn [] ((fn [a b] (__ a b)) diff --git a/src/path_to_answer_sheet.clj b/src/path_to_answer_sheet.clj index 6a0ae59..f410ecd 100644 --- a/src/path_to_answer_sheet.clj +++ b/src/path_to_answer_sheet.clj @@ -54,6 +54,7 @@ "functions" {"__" [20 10 5 30 2 + 15 20 "*"] "___" ['(fn [f] (f 5)) '(fn [f] 25)]}