We then allow the system to transform the integer into a complex number through these steps and then add the two complex numbers. Then when the system is required to operate on objects of different types it can successively raise the lower types until all the objects are at the same level in the tower. For instance, if we do not supply a special procedure for finding the real part of an integer, we should nevertheless expect that real-part will be defined for integers by virtue of the fact that integers are a subtype of complex numbers. In a tower, we can arrange for this to happen in a uniform way by modifying apply-generic . If the required operation is not directly defined for the type of the object given, we raise the object to its supertype and try again.
Exercise discusses a way to implement such a lowering operation.
If the data types in our system can be naturally arranged in a tower, this greatly simplifies the problems of dealing with generic operations on different types, as we have seen. Unfortunately, this is usually not the case. Figure illustrates a more complex arrangement of mixed types, this one showing relations among different types of geometric figures. We see that, in general, a type may have more than one subtype. Triangles and quadrilaterals, for instance, are both subtypes of polygons.