#lang racket ;; modify type-tag, contents, and attach-tag so that primitive numbers need not ;; be tagged. (define (type-tag datum) (cond [(pair? datum) (car datum)] [(number? datum) 'scheme-number] [else (error "Bad tagged datum -- TYPE-TAG" datum)])) (define (contents datum) (cond [(pair? datum) (cdr datum)] [(number? datum) datum] [else (error "Bad tagged datum -- CONTENTS" datum)])) (define (attach-tag type-tag contents) (if (number? contents) contents (cons type-tag contents)))