Practice 2.80
(define (=zero? x)
(apply-generic '=zero? x))
install-scheme-number-package add
(put '=zero? 'scheme-number
(lambda (x)
(if (number? x)
(= x 0)
(else
(error "type-error")))))
install-rational-package add
(put '=zero? 'rational
(lambda (x)
(and (= (numer x) 0)
(not (= (denom x) 0)))))
install-complex-package add
(put '=zero? 'complex
(lambda (x)
(and (= (real-part x) 0)
(= (imag-part x) 0))))