問題2.54

(define (equal? li1 li2)
  (cond ((and (null? li1) (null? li2)) #t)
        ((and (symbol? li1) (symbol? li2)) (eq? li1 li2))
        ((and (pair? li1) (pair? li2))
         (and (equal? (car li1) (car li2))
              (equal? (cdr li1) (cdr li2))))
        (else (eq? li1 li2))))

(equal? '(a b c) '(a b c))
;#t

(equal? '(a b c) '(a b a))
;#f

(equal? '(a b (c d) e f (g (h) i)) '(a b (c d) e f (g (h) i)))
;#t

(equal? '(a b c d (e) f (g h i)) '(a b (c d) e f (g (h) i)))
;#f

(equal? '() '())
;#t

(equal? 10 10)
;#t