[Current] [News] [Glance] [Discussions] [Instructions] [Search] [Links] [Handouts] [Outlines] [Readings] [Labs] [Homeworks] [Quizzes] [Exams] [Examples] [Fall2000.01] [Spring2000]
a. Please scan through the reading on records.
b. Make a copy of compound.ss
.
c. Scan through that file to make sure that you understand all the procedures.
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.
Define a procedure filter-by-color
that takes two arguments --
a list 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 ls
.
a. Find a way to set the melting point of a compound to an illegal temperature.
b. Find a way to make a vector that compound?
identifies
as a compound. You may not use make-compound
or
compound-copy
to build your new vector. However,
you may use either procedure to create a ``helper'' compound.
Write a set of definitions for a record type shirt
, to
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 --
a vector vec
of records of type shirt
, sorted
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 vec
, or #f
if there is no such record.
Monday, 27 November 2000
http://www.math.grin.edu/~stone/courses/scheme/records.xhtml
(Created April 29, 1997; Last modified April 21, 2000)
[Current] [News] [Glance] [Discussions] [Instructions] [Search] [Links] [Handouts] [Outlines] [Readings] [Labs] [Homeworks] [Quizzes] [Exams] [Examples] [Fall2000.01] [Spring2000]
Disclaimer Often, these pages were created "on the fly" with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.
This page may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CS151/2000F/Labs/records.html
Source text last modified Mon Nov 27 10:55:53 2000.
This page generated on Mon Nov 27 10:58:14 2000 by Siteweaver. Validate this page's HTML.
Contact our webmaster at rebelsky@grinnell.edu