From 065997426215a295364c7da35a87544f423f8501 Mon Sep 17 00:00:00 2001 From: Ramakrishnan Muthukrishnan Date: Thu, 27 May 2010 19:56:18 +0530 Subject: [PATCH] solution to 1.42 --- src/sicp/ex1_42.clj | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/sicp/ex1_42.clj diff --git a/src/sicp/ex1_42.clj b/src/sicp/ex1_42.clj new file mode 100644 index 0000000..1c0eef8 --- /dev/null +++ b/src/sicp/ex1_42.clj @@ -0,0 +1,14 @@ +(ns sicp.ex1_42 + (:use [clojure.contrib test-is] + [sicp utils] + [sicp ch1_3])) + +(defn compose [f g] + (fn [x] (f (g x)))) + +(comment +((compose square inc) 6) +;;=> 49 +((compose square square) 2) +;;=> 16 + ) \ No newline at end of file -- 2.45.2