Next: Explicit renaming macros, Previous: Weak references, Up: System features
Scheme48 allows optional type annotations with the loophole
special form from the loopholes
structure.
This is exactly equivalent in semantics to expression, except the static type analyzer is informed that the whole expression has the type type. For details on the form of type, see Static type system.
Type annotations can be used for several different purposes:
primitive-cwcc
,
primitive-catch
, and with-continuation
devices (to be
documented in a later edition of this manual).
To see an example of the second use, see rts/jar-defrecord.scm in Scheme48's source tree.
Note: Type annotations do not damage the safety of Scheme's type system. They affect only the static type analyzer, which does not change run-time object representations; it only checks type soundness of code and generates warnings for programs that would cause run-time type errors.