Blob


1 ;; The first three lines of this file were inserted by DrScheme. They record metadata
2 ;; about the language level of this file in a form that our tools can easily process.
3 #reader(lib "htdp-advanced-reader.ss" "lang")((modname |40.1|) (read-case-sensitive #t) (teachpacks ((lib "guess-gui.ss" "teachpack" "htdp") (lib "guess.ss" "teachpack" "htdp") (lib "gui.ss" "teachpack" "htdp") (lib "draw.ss" "teachpack" "htdp"))) (htdp-settings #(#t constructor repeating-decimal #t #t none #f ((lib "guess-gui.ss" "teachpack" "htdp") (lib "guess.ss" "teachpack" "htdp") (lib "gui.ss" "teachpack" "htdp") (lib "draw.ss" "teachpack" "htdp")))))
4 Exercise 40.1.3. Show how to implement the following structure definitions as functions:
6 1.
8 (define-struct movie (title producer))
9 2.
11 (define-struct boyfriend (name hair eyes phone))
12 3.
14 (define-struct cheerleader (name number))
15 4.
17 (define-struct CD (artist title price))
18 5.
20 (define-struct sweater (material size producer))
22 Pick one and demonstrate that the expected laws hold. Solution