From 188e7aa3e2b5398284a4aba1af00589b487da03f Mon Sep 17 00:00:00 2001
From: Ramakrishnan Muthukrishnan <vu3rdd@gmail.com>
Date: Mon, 7 Jun 2010 23:30:52 +0530
Subject: [PATCH] solution to 2.4

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

diff --git a/src/sicp/ex2_4.clj b/src/sicp/ex2_4.clj
new file mode 100644
index 0000000..82f8a2d
--- /dev/null
+++ b/src/sicp/ex2_4.clj
@@ -0,0 +1,19 @@
+(ns sicp.ex2_4
+  (:use [sicp utils]
+	[clojure.test]))
+
+(defn cons [x y]
+  (fn [f] (f x y)))
+
+(defn car [x]
+  (x (fn [p q] p)))
+
+(defn cdr [x]
+  (x (fn [p q] q)))
+
+;; cons takes x and y and returns a function which takes a param as input
+;; which is nother function and calls that function with x and y. Now
+;; car of a cons cell, calls this function returned by cons, with another
+;; function as input parameter. Remember that cons returns a func which takes
+;; another func as input. This function passed takes 2 inputs p and q and
+;; returns p in the case of car and q for cdr.
-- 
2.45.2