Version: 5.1.3
6 Typed Regions
The with-type for allows for localized Typed Racket regions in otherwise untyped code.
(with-type result-spec fv-clause body ...+) | |||||||||||||||||||||||||||||||
(with-type export-spec fv-clause body ...+) | |||||||||||||||||||||||||||||||
|
The first form, an expression, checks that body ...+ has the type type.
If the last expression in body ...+ returns multiple values, type must
be a type of the form (values t ...).
Uses of the result values are appropriately checked by contracts generated from
type.
The second form, which can be used as a definition, checks that each of the export-ids has the specified type. These types are also enforced in the surrounding code with contracts.
The ids are assumed to have the types ascribed to them; these types are converted to contracts and checked dynamically.
Examples: | |||||||||||||||||||||||||||||||
|