Composite Types
Composite types are basic types that are built up from basic scalar types. The following composite types are available in ASCET:
- Array (
) - Matrix (
) - Characteristic line (
) - Characteristic map (
) - Distribution (
)
Composite types consist of basic scalar types. Arrays and matrices can consist of all four scalar types, characteristic lines, maps, and distributions only of the three arithmetic types. Unlike basic scalar types, composite types are reference types. When assigning two variables of reference types to each other, not the values are assigned (and copied), but the references to the variable.
All reference types have access methods for their elements:
- set (reference type a): This is an assignment of the reference to reference type a. After such an assignment, both elements (the assigned as well as the assigning) are the identical element!
- get: This returns a reference to the element of composite type.
Argument passing in method calls works in the same manner as assignments. A reference is passed to the element. As a consequence, a change to the argument, for instance by assigning a value to it, is also reflected outside the method. This mechanism is equivalent to a "call by reference" in programming languages like C.
See also
Variant Size for Arrays and Matrices
Variable Size for Arrays and Matrices
Initialization of Composite Elements