projects
/
sicp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
580a47f
)
added more tests
author
Ramakrishnan Muthukrishnan
<vu3rdd@gmail.com>
Thu, 27 May 2010 15:36:26 +0000
(21:06 +0530)
committer
Ramakrishnan Muthukrishnan
<vu3rdd@gmail.com>
Thu, 27 May 2010 15:36:26 +0000
(21:06 +0530)
src/sicp/ex1_41.clj
patch
|
blob
|
history
diff --git
a/src/sicp/ex1_41.clj
b/src/sicp/ex1_41.clj
index 17bf21c595a97e2ca00c4b16d9e7b679905badcd..c6a16f028f9c704f9dc662a5f3033f3ae5956a94 100644
(file)
--- a/
src/sicp/ex1_41.clj
+++ b/
src/sicp/ex1_41.clj
@@
-6,6
+6,18
@@
(defn doub [f]
(fn [x] (f (f x))))
+(deftest test-doub-doub-doub-inc-5
+ (is (= (((doub (doub doub)) inc) 5)
+ 21)))
+
+(deftest test-doub-inc-1
+ (is (= ((doub inc) 1)
+ 3)))
+
+(deftest test-doub-doub-inc-1
+ (is (= (((doub (doub doub)) inc) 1)
+ 17)))
+
(comment
(((doub (doub doub)) inc) 5)
;;=> 21