Lab: Using Racket's structured types

Assigned
Wednesday, 3 November 2021
Summary
We consider how and why to use structured data in Racket.
Prerequisites
Precondition checking. Hash tables.

Important syntax and procedures

(struct name (field1 field2 ...)) - Creates a new structured type, with methods named name, name? name-field1, name-field2, and so on and so forth.

Preparation

a. Start DrRacket.

b. Grab the code for this lab.

c. If we did not review the self checks at the start of class, review the self checks with your partner.

d. Do the lab.

Acknowledgements

This lab was (mostly) newly written in spring 2019. The code was extracted to a separate file in Fall 2021. Fall 2021 saw the arrival of a new problem (chirps-by and chirps-tagged-with), the de-emphasizing of the hash table problem, and the addition of a few new extras (ordering of dates, selecting chirps by date). problem.