From: Ramakrishnan Muthukrishnan Date: Thu, 27 May 2010 14:26:18 +0000 (+0530) Subject: solution to 1.42 X-Git-Url: https://git.rkrishnan.org/%5B/frontends/about.html?a=commitdiff_plain;h=065997426215a295364c7da35a87544f423f8501;p=sicp.git solution to 1.42 --- 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