the declares the type of an expression.

Syntax

(the ⟨type⟩ ⟨expr⟩)

Semantics

  • the is the standard way to resolve ambiguity in an expression.
  • It is especially useful around numeric literals, collection builders, sequence builders, and conversions.
  • Unlike declare, the works directly at expression sites.
  • the accepts explicit forall binders; when present, those type variables are scoped over the enclosed expression.
  • In a branch of catch or handle, (the ⟨type⟩ var) is not an expression: it catches every exception of type ⟨type⟩ and binds it to var.

Example

(the (List F32) [1 2 3 4])