Practice 2.78
(define (type-tag z)
(cond ((pair? z) (car z))
((number? z) 'scheme-number)
(else
(error "type error"))))
(define (contents z)
(cond ((number? z) z)
((pair? z) (cdr z))
(else
(error "type error"))))
(define (attach-tag type-tag content)
(if (number? content)
content
(cons type-tag content)))