Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Types

Every type is a value: a type reference is an expression whose value is of the type type. Types are not a separate syntactic category; the type forms described below are expression forms, and every position which requires a type takes an expression. Compile-time assertions ensure that expressions are of the type type when required.

Type values are produced by the expression forms:

  1. the built-in types: boolean, numeric, type, and namespace,
  2. the function type form,
  3. the handle type form,
  4. the slice type form,
  5. a tuple expression whose elements are all type values,
  6. a reference to a structure or enumeration declaration,
  7. a reference to a define which is bound to a type value, and
  8. a reference to a scope binding which is bound to a type value.

Runtime Representation

A type is runtime representable when values of that type can exist at runtime. A value whose type is not runtime representable exists only at compile time and cannot exist at runtime.

The namespace and type types have no runtime representation, while the numeric and boolean types do. The function, structure, enumeration, and tuple types are runtime representable when all their component types are; the handle and slice types require that their operand type value is runtime representable, and are themselves runtime representable.