|
|
The UNO Type SystemThis document describes the type system of core UNO, a distributed computation model. It should not be confused with the larger type system of UNOIDL, a description language used to notate core UNO types and related, non–core-UNO entities like modules, typedefs, and constants. The UNO type system comprises two kinds of entities, namely types and polymorphic struct type templates. Each entity has a unique name. The names of UNO type system entities are taken from an alphabet consisting
of the Latin capital letters
“ identifier → segment
( (Since the names of UNO type system entities are unique, and some entities
have certain fixed names that match the grammar for identifiers, and other
entities have names that are arbitrary identifiers, it follows that those
entities of the latter kind may not have as names identifiers that are already
reserved by entities of the first kind—namely
“ Each UNO type t has a non-empty set of values Vt, and a default value dt ∈ Vt. Two UNO values are equal if and only if they have the same type t and both denote the same element of Vt. The UNO type system consists of the following (sets of) types:
The non-void, non-exception UNO types are The non-any UNO types are The non-exception UNO types are The basic UNO types are The simple UNO types are The primitive UNO types are The aggregating UNO types are the struct types and the exception types. The fundamental UNO types are The unsigned UNO types are Function IndicesOften, a mapping between the members of a given interface type and a subset of the integers (so called function indices) is needed. In the following, one such mapping is defined, to be consistently used wherever the concept of function indices is needed in conjunction with UNO. For an interface type t, define the list of direct bases 〈b1, …, bkb〉, kb ≥ 0, the list of direct attributes 〈a1, …, aka〉, ka ≥ 0, and the list of direct methods 〈m1, …, mkm〉, km ≥ 0, as above. Additionally, define the list of direct attribute functions of t, written 〈af1, …, afkaf〉, kaf ≥ 0, as the result of substituting in the list 〈a1, …, aka〉 each element ai with either one or two new elements, retaining the overall order. If the argument ai is read–write, then it is replaced with the two elements G(ai) and S(ai), in that order; if the argument ai is read-only, then it is replaced with the single element G(ai). (The attribute function G(a) represents a getter function for the attribute a, while the attribute function S(a) represents a setter function for a.) Additionally, define the set of member functions of t to be the set of members of t, but with all attributes replaced with the respective attribute functions. The algorithm functionIndices, to construct a bijective mapping from function indices (a subset of the integers) to member functions of a given interface type, in pseudo-code notation: type S: set of interface type That the function indices start at three, instead of at zero, has
historic reasons: Indices 0–2 are reserved for the three pseudo methods
of
|



