Enumerations

Many procedures in many libraries accept arguments from a finite set, or subsets of a finite sets to describe a certain mode of operation, or several flags to describe a mode of operation. Examples in the R6RS include the endianness for bytes-object operations, and file and buffering modes in the I/O library. Offering a default policy for dealing with such values fosters portable and readable code, much as records do for compound values, or multiple values for procedures computing several values. Moreover, representations of sets from a finite set of options should offer the standard set operations, as they tend to occur in practice. (One such set operation is the complement, which makes lists of symbols a less than suitable representation.)

Different Scheme implementations have taken different approaches to this problem in the past, which suggests that a default policy does more than merely encode what any sensible programmer would do anyway. As possible uses occur quite frequently, this particular aspect of interface construction has been standardized.