Topic: casting a variable to a different type
Topic: data type as a set of operations
Topic: generic operations and polymorphism
Topic: non-exclusive data type
Topic: ref_any or Object data type
Topic: variant data types
| |
Summary
A type may be a union of types, allowing type selection at execution time. For instance a list component may be an atom or two list links. Union types which are similar are called variant types. When using union types, predicates are defined for differentiating component types, and type conversions allow accessing and modifying union types in terms of component types. (cbb 5/80)
Constants can be of several types. (cbb 1/90)
Subtopic: union as shared
Quote: in C, a union type is large enough to contain either type; programmer must assure appropriate access [»ritcDM7_1978c]
| Subtopic: union as sum
Quote: if types define subsets of a universal type, then their unions and intersections are well-defined [»reynJC9_1983]
| Subtopic: union type operation
Quote: can define union types for types which participate in the same operations but do not share other attributes [»maclBJ12_1983]
| Quote: a union type defines operations for projection, injection, and inspection [»demeA3_1979]
| QuoteRef: branP11_1971 ;; allows a type to a union of types eg list processing car(x) atom list
| Subtopic: union type tag
Quote: Cyclone has growable memory region, tagged union, polymorphism, and exceptions
| Quote: a union type needs a predicate to distinguish different formats [»burgWH_1975]
| Quote: union mode objects have a fixed mode [»wegbB5_1974, OK]
| Quote: a union mode postpones the selection of a mode [»wegbB5_1974]
| Quote: a C enumeration is really treated as 'int'; not useful for tagged unions [»jimT6_2002]
| Subtopic: constant as union type
Quote: a constant is type compatible if it can be a value of that type; it can be compatible with many types [»clayR4_1978]
| Subtopic: problems with union type
Quote: a type field leads to two kinds of errors in large programs: failure to test the type field and missed cases in a switch [»stroB_1991]
|
Related Topics
Topic: casting a variable to a different type (7 items)
Topic: data type as a set of operations (38 items)
Topic: generic operations and polymorphism (67 items)
Topic: non-exclusive data type (16 items)
Topic: ref_any or Object data type (9 items)
Topic: variant data types (7 items)
|