]> git.rkrishnan.org Git - sicp.git/commitdiff
solution to 1.34
authorRamakrishnan Muthukrishnan <vu3rdd@gmail.com>
Thu, 6 May 2010 03:28:55 +0000 (08:58 +0530)
committerRamakrishnan Muthukrishnan <vu3rdd@gmail.com>
Thu, 6 May 2010 03:28:55 +0000 (08:58 +0530)
src/sicp/ex1_34.clj [new file with mode: 0644]

diff --git a/src/sicp/ex1_34.clj b/src/sicp/ex1_34.clj
new file mode 100644 (file)
index 0000000..971f23c
--- /dev/null
@@ -0,0 +1,14 @@
+(ns sicp.ex1_34
+  (:use [sicp utils]))
+
+(defn f [g]
+  (g 2))
+
+(deftest test-f-with-square-as-arg
+  (is (= (f square) 4)))
+
+;; (what iwll happen if we do (f f)
+(comment
+"It will first invoke (f 2), which will again invoke (2 2), but
+ 2 is not a function, so it will give an error at that point."
+)
\ No newline at end of file