;; The first three lines of this file were inserted by DrScheme. They record metadata ;; about the language level of this file in a form that our tools can easily process. #reader(lib "htdp-beginner-reader.ss" "lang")((modname 15.8.1) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor mixed-fraction #f #t none #f ()))) (require installed-teachpacks/picturing-programs) ; Worked exercise 15.8.1 ; classify : anything -> string (check-expect (classify (circle 5 "solid" "green")) "image") (check-expect (classify "hello there") "string") (check-expect (classify 74) "number") (check-expect (classify true) "other") (define (classify thing) ; thing anything (cond [(image? thing) "image"] [(string? thing) "string"] [(number? thing) "number"] [else "other"] ))