a. Make a copy of
b. Scan through that file to make sure that you understand all the procedures.
c. Start DrScheme.
a. Try the compoound examples given in the reading on records to see if they behave as I said they would.
b. Try a few of your own variations.
c. Explain why the attempted fake is not listed as a compound. Hint:
Think about the order of the
Define a procedure
filter-by-color that takes two arguments --
ls of records of type
compound and a color
symbol -- and returns a list of the names of compounds of that color that
are elements of
a. Can you set the melting point of a compound to an illegal temperature? If so, how? If not, why not? (Note that there are other ways to modify compounds than to use the record's provided procedures.)
b. Find a way to make a vector that
as a compound. You may not use
compound-copy to build your new vector. However,
you may use either procedure to create a ``helper'' compound
from which you copy values.
Write a set of definitions for a record type
be used in a program that keeps track of the inventory of a clothing store.
Provide fields for catalog number, intended gender of wearer, size, color,
price, and quantity in stock. Only the last two fields should be mutable.
Define a procedure that sorts a vector of records of type
shirt into ascending order by catalog number.
Adapt the binary search procedure so that it takes two arguments --
vec of records of type
by the procedure defined in the previous exercise, and a catalog number
catno -- and returns the entire record that contains that
catalog number, if there is one in
if there is no such record.
Monday, 27 November 2000 [Samuel A. Rebelsky]
http://www.math.grin.edu/~stone/courses/scheme/records.xhtml(Created April 29, 1997; Last modified April 21, 2000)
Monday, 30 April 2001 [Samuel A. Rebelsky]
Disclaimer: I usually create these pages on the fly. This means that they are rarely proofread and may contain bad grammar and incorrect details. It also means that I may update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.
This page was generated by Siteweaver on Thu May 3 23:07:59 2001.
This page may be found at
You may validate this page's HTML.
The source was last modified Wed May 2 09:35:07 2001.