From 33b355d52ed862757d9565079f662a11a0dca341 Mon Sep 17 00:00:00 2001
From: Ramakrishnan Muthukrishnan <vu3rdd@gmail.com>
Date: Sun, 27 Jun 2010 22:34:29 +0530
Subject: [PATCH] solution to 2.21

---
 src/sicp/ex2_21.clj | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 src/sicp/ex2_21.clj

diff --git a/src/sicp/ex2_21.clj b/src/sicp/ex2_21.clj
new file mode 100644
index 0000000..cdabdd8
--- /dev/null
+++ b/src/sicp/ex2_21.clj
@@ -0,0 +1,18 @@
+(ns sicp.ex2_21
+  (:use [clojure test]
+	[sicp [utils :only (square)]]))
+
+(defn square-list-1 [items]
+  (if (empty? items)
+    nil
+    (cons (square (first items))
+	  (square-list-1 (rest items)))))
+
+(deftest test-square-list-1
+  (is (= (square-list-1 (list 1 2 3 4)) (list 1 4 9 16))))
+
+(defn square-list-2 [items]
+  (map (fn [x] (square x)) items))
+
+(deftest test-square-list-2
+  (is (= (square-list-2 (list 1 2 3 4)) (list 1 4 9 16))))
-- 
2.45.2