;; The first three lines of this file were inserted by DrRacket. 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 repeating-decimal #f #t none #f ())))
(require installed-teachpacks/picturing-programs)

; Exercise 15.8.1

; classify : anything (image, string, number, or anything else) ->
; string ("image", "string", "number", or "other")

(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" ]
        )
  )