SICP Practice

Practice 2.87

(put '=zero? 'scheme-number
  (lambda (x)
    (if (= x 0)
        #t
        #f)))

(put '=zero? 'real
  (lambda (x)
    (if (= 0 (numerator (inexact->exact x)))
        #t
        #f)))

(put '=zero? 'rational
  (lambda (x)
    (if (= 0 (numerator x))
        #t
        #f)))

(put '=zero? 'complex
  (lambda (x)
    (if (and (= 0 (real-part x)) (= 0 (imag-part x)))
        #t
        #f)))

(put '=zero? 'poly
  (lambda (x)
    (empty-termlist? (term-list x))))