|
home—lectures—recipe—exams—hws—D2L—breeze (snow day; distance)
Review (optional):
video: a struct for DVDs (6m50s)
Another example of using structs to represent DVDs
(and practice using the design recipe).
The dvd struct will be used, along with book, in the following examples.
code:
The initial version to follow along and type in yourself
(starting around line 80, the data def'n for
Making a lib-item: video: union-of-structs (35m30s)
In the template for a union-type, if we are in a branch where we know we have a struct,
let's go ahead and pull out the fields of that struct right here in that cond-branch.
code:
The initial version to follow along and type in yourself
(starting around line 100, the data def'n for
Practice for class-discussion: htdp: spiders, dillos, and more
Note:“girth” means circumference
But don't nest other templates;
call a helper-function rather than process a union-type inside a struct-type-handling-function.
video (23m53s)
home—lectures—recipe—exams—hws—D2L—breeze (snow day; distance)
©2017, Ian Barland, Radford University Last modified 2017.Oct.16 (Mon) |
Please mail any suggestions (incl. typos, broken links) to ibarlandradford.edu |