projects
/
sicp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
689f4a6
)
an important bug fixed on equal? function
author
Ramakrishnan Muthukrishnan
<vu3rdd@gmail.com>
Tue, 7 Sep 2010 10:56:50 +0000
(16:26 +0530)
committer
Ramakrishnan Muthukrishnan
<vu3rdd@gmail.com>
Tue, 7 Sep 2010 10:56:50 +0000
(16:26 +0530)
src/sicp/ex2_54.clj
patch
|
blob
|
history
diff --git
a/src/sicp/ex2_54.clj
b/src/sicp/ex2_54.clj
index 0039c290c5f20fd823f05b6a462b2bc4ec559c96..3ed52d23b16a11433f61492b466620e08735be03 100644
(file)
--- a/
src/sicp/ex2_54.clj
+++ b/
src/sicp/ex2_54.clj
@@
-10,7
+10,8
@@
(= x y)))
(defn equal? [a b]
- (cond (empty? a) (empty? b)
+ (cond (and (atom? a) (atom? b)) (eq? a b)
+ (and (not (atom? a)) (not (atom? b))) (and (empty? a) (empty? b))
(atom? (first a))
(if (eq? (first a) (first b))
(equal? (rest a) (rest b))