;; This file contains excerpts from the textbook Concrete ;; Abstractions: An Introduction to Computer Science Using Scheme, by ;; Max Hailperin, Barbara Kaiser, and Karl Knight, Copyright (c) 1998 ;; by Brooks/Cole Publishing Company. This file may not be reproduced ;; or redistributed other than for use with that textbook. (define-class 'oxford-shirt item-class '(color neck sleeve specified-yet) '( )) (class/set-method! oxford-shirt-class 'init (lambda (this) (item^init this 1950) (oxford-shirt/set-specified-yet! this #f))) (class/set-method! oxford-shirt-class 'display (lambda (this) (if (oxford-shirt/get-specified-yet this) (begin (display (oxford-shirt/get-color this)) (display " Oxford-cloth shirt, size ") (display (oxford-shirt/get-neck this)) (display "/") (display (oxford-shirt/get-sleeve this)) (display "; ")) (display "Oxford-cloth shirt; ")) (item^display this))) (class/set-method! oxford-shirt-class 'input-specifics (lambda (this) (display "What color?") (newline) (oxford-shirt/set-color! this (input-selection '("Ecru" "Pink" "Blue" "Maize" "White"))) (display "What neck size? ") (oxford-shirt/set-neck! this (input-integer-in-range 15 18)) (display "What sleeve length? ") (oxford-shirt/set-sleeve! this (input-integer-in-range 32 37)) (oxford-shirt/set-specified-yet! this #t) 'inputted))