Array Upgrading (original) (raw)
ANSI Common Lisp 15 Arrays
15.1 Array Concepts
15.1.2 Specialized Arrays
15.1.2.1 Array Upgrading
The upgraded array element type of a type _T1_is a type T2 that is a supertype of _T1_and that is used instead of T1 whenever _T1_is used as an _array element type_for object creation or type discrimination.
During creation of an array, the element type that was requested is called the expressed array element type. The upgraded array element type of the _expressed array element type_becomes the actual array element type of the array that is created.
Type upgrading implies a movement upwards in the type hierarchy lattice. A type is always a subtype of its upgraded array element type. Also, if a type Tx is a subtype of another type Ty, then the upgraded array element type of _Tx_must be a subtype of the upgraded array element type of Ty. Two disjoint types can be upgraded to the same type.
The upgraded array element type T2 of a type _T1_is a function only of T1 itself; that is, it is independent of any other property of the _array_for which T2 will be used, such as rank, adjustability, fill pointers, or displacement. The function upgraded-array-element-typecan be used by conforming programs to predict how the _implementation_will upgrade a given type.