]> git.rkrishnan.org Git - sicp.git/commitdiff
text examples until 2.3.2
authorRamakrishnan Muthukrishnan <vu3rdd@gmail.com>
Wed, 1 Sep 2010 19:54:55 +0000 (01:24 +0530)
committerRamakrishnan Muthukrishnan <vu3rdd@gmail.com>
Wed, 1 Sep 2010 19:54:55 +0000 (01:24 +0530)
src/sicp/ch2_3.clj [new file with mode: 0644]

diff --git a/src/sicp/ch2_3.clj b/src/sicp/ch2_3.clj
new file mode 100644 (file)
index 0000000..28df094
--- /dev/null
@@ -0,0 +1,7 @@
+(ns sicp.ch2_3)
+
+(defn memq [item x]
+  (cond
+    (empty? x) false
+    (= (first x) item) x
+    :else (memq item (rest x))))
\ No newline at end of file