This site is a static rendering of the Trac instance that was used by R7RS-WG1 for its work on R7RS-small (PDF), which was ratified in 2013. For more information, see Home. For a version of this page that may be more recent, see LabelRecordConstructorBenefits in WG2's repo for R7RS-large.


2010-03-11 00:40:53

Label Record Constructor Benefits

From SRFI-57

The ability to populate record values by labels provides a more robust and readable alternative, especially useful when a record has more than two or three fields, or if it inherits fields from a type scheme. Field labels are checked for validity and the macro may be compiled to a positional constructor at expansion time, thus eliminating a large class of potential programmer errors at no cost in efficiency.