RAD Derived Types

In addition to the base types, RAD supports the following derived types:

  • Enumeration – A set of user-defined tokens. Like C enumerations, RAD enumerations may have specific integer values associated with them. Unlike C enumerations, RAD enumerations and integers are not interchangeable. Among other things, this lack of interchangeability means that an enumeration data value may not take on values outside those defined by the enumeration, which precludes the common but questionable practice of using enumerated types for bit-field values.

  • Array – An ordered list of data items of a fixed type. Arrays do not have a predefined size.

  • Structure – A record consisting of a fixed set of typed, uniquely named fields. A field's type may be a base type or derived type, or even another structure type.

Derived types offer enormous flexibility. However, one important constraint imposed on derived types is that recursive type references are prohibited. Thus, complex self-referencing data types, for example, linked lists or trees, must be mapped into simpler forms before consumption.