the declares the type of an expression.
Syntax
(the ⟨type⟩ ⟨expr⟩)
Semantics
theis the standard way to resolve ambiguity in an expression.- It is especially useful around numeric literals, collection builders, sequence builders, and conversions.
- Unlike
declare,theworks directly at expression sites. theaccepts explicitforallbinders; when present, those type variables are scoped over the enclosed expression.- In a branch of
catchorhandle,(the ⟨type⟩ var)is not an expression: it catches every exception of type⟨type⟩and binds it tovar.
Example
(the (List F32) [1 2 3 4])