This note explains how to create and use records in MzScheme/DrScheme. Records are called structs. These notes demonstrate how to specify a type of struct, how to create specific structs, and how to access fields inside of structs. Assume we want to make a struct for phone book entries containing a name and an extension. We define the struct as follows: (define-struct pbentry (name ext)) Here, pbentry is the type of the struct and name and ext are the fields. When you define a struct type, DrScheme automatically defines the constructors, getters, setters, and a recognizer for the struct. For our pbentry struct above, DrScheme automatically defines the following operators (for each, I give the types in as input1 ... inputn -> output. The type value stands for any Scheme datum; void means "no return value". ; constructor make-pbentry : value value -> pbentry ; getters pbentry-name : pbentry -> value pbentry-ext : pbentry -> value ; setters set-pbentry-name! : pbentry value -> void set-pbentry-ext! : pbentry value -> void ; recognizer pbentry? : value -> boolean Here's a sample interaction with DrScheme > (define-struct pbentry (name ext)) > (define e1 (make-pbentry 'kathi 5118)) > (define e2 (make-pbentry 'fred 6722)) > e1 # > (pbentry-name e1) kathi > (pbentry-ext e2) 6722 > (pbentry? e1) #t > (pbentry? (cons 'kathi null)) #f > (car e1) car: expects argument of type ; given # > The last expression shows that structs are not the same as lists. List operations can't access structs. One can, however, create lists of structs, just as you can create lists of any values. For example, here's a sample phonebook: > (define phonebook (list e1 e2)) > phonebook (# #) > (pbentry-ext (car phonebook)) 5118 > You can use structs anywhere you would any other value in Scheme. In other words, you can pass them as arguments, return them from functions, etc. That should be all you need to know about structures. If you have any questions, post away.