Scheme Programming/Record Types

One of the additions that R7RS provided over R5RS is the ability to define "record types", which are new data types. Record types are disjoint types just like numbers, strings, and pairs. The R7RS syntax is based on SRFI 9, where record types are just a collection of named data fields. If you are familiar with C structs, these are a similar concept. It is possible in Scheme to define objects including methods, as seen in ../Object Orientation/.

In the define-record-type syntax, there are four parts: the name of the type, the constructor, the predicate, and a series of getters and setters.