From de9c515d5bcef9c012d602464b34a0ef2dac2ae8 Mon Sep 17 00:00:00 2001
From: Ramakrishnan Muthukrishnan <vu3rdd@gmail.com>
Date: Sat, 10 Jul 2010 12:26:41 +0530
Subject: [PATCH] solution to 2.27

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

diff --git a/src/sicp/ex2_27.clj b/src/sicp/ex2_27.clj
new file mode 100644
index 0000000..957ec2f
--- /dev/null
+++ b/src/sicp/ex2_27.clj
@@ -0,0 +1,16 @@
+(ns sicp.ex2_27
+  (:refer-clojure :exclude (reverse))
+  (:use [clojure.test]))
+
+(def x (list (list 1 2) (list 3 4)))
+
+(defn deep-reverse [lst]
+  (cond (not (seq? lst)) lst
+	(empty? lst) nil
+	:else (cons (deep-reverse (last lst)) (deep-reverse (butlast lst)))))
+
+(deftest test-simple-list
+  (are [x y] [= x y]
+       (deep-reverse '(1 2 3 4))     '(4 3 2 1)
+       (deep-reverse '((1 2) 3 4))   '(4 3 (2 1))
+       (deep-reverse '((1 2) (3 4))) '((4 3) (2 1))))
-- 
2.45.2