7 Contracts
Contracts in Guide: Racket introduces contracts.
The contract system guards one part of a program from another. Programmers specify the behavior of a module’s exports via provide/contract, and the contract system enforces those constraints.
symbols, booleans, characters, and null, which are treated as contracts that recognize themselves, using eq?,
strings and byte strings, which are treated as contracts that recognize themselves using equal?,
numbers, which are treated as contracts that recognize themselves using =,
regular expressions, which are treated as contracts that recognize byte strings and strings that match the regular expression, and
predicates: any procedure of arity 1 is treated as a predicate. During contract checking, it is applied to the values that appear and should return #f to indicate that the contract failed, and anything else to indicate it passed.