13 (cond (and (atom? a) (atom? b)) (eq? a b)
14 (and (not (atom? a)) (not (atom? b))) (and (empty? a) (empty? b))
16 (if (eq? (first a) (first b))
17 (equal? (rest a) (rest b))
19 :else (and (equal? (first a) (first b))
20 (equal? (rest a) (rest b)))))
22 (deftest test-equality
24 (equal? '(1) '(1)) true
25 (equal? '(1) '(2)) false
26 (equal? '(1 2) '(1 2)) true
27 (equal? '(1 2 (3)) '(1 2 (3))) true
28 (equal? '(1 2 3) '(1 2 (3))) false))