From 2b52c29fc3465946a6544e5ca31494f5db04970d Mon Sep 17 00:00:00 2001 From: David Byrne Date: Sun, 24 Apr 2011 21:23:16 -0400 Subject: [PATCH] Problem added - Juxtaposition --- src/foreclojure/data_set.clj | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/foreclojure/data_set.clj b/src/foreclojure/data_set.clj index a1b1fa24..5b4b1a53 100644 --- a/src/foreclojure/data_set.clj +++ b/src/foreclojure/data_set.clj @@ -603,4 +603,15 @@ :tests ["(= [3 2 1] ((__ rest reverse) [1 2 3 4]))" "(= 5 ((__ (partial + 3) second) [1 2 3 4]))" "(= true ((__ zero? #(mod % 8) +) 3 5 7 9))" - "(= \"HELLO\" ((__ #(.toUpperCase %) #(apply str %) take) 5 \"hello world\"))"]}))) + "(= \"HELLO\" ((__ #(.toUpperCase %) #(apply str %) take) 5 \"hello world\"))"]}) + + (insert! :problems + {:_id 59 + :title "Juxtaposition" + :times-solved 0 + :restricted ["juxt"] + :description "Take a set of functions and return a new function that takes a variable number of arguments and returns a sequence containing the result of applying each function left-to-right to the argument list." + :tags ["medium" "higher-order-functions" "core-functions"] + :tests ["(= [21 6 1] ((__ + max min) 2 3 5 1 6 4))" + "(= [\"HELLO\" 5] ((__ #(.toUpperCase %) count) \"hello\"))" + "(= [2 6 4] ((__ :a :c :b) {:a 2, :b 4, :c 6, :d 8 :e 10}))"]})))