Our next obscure function is subtypep. This function allows the program to determine whether one type is a subtype of a second type. The return values depend on the actual types available in the implementation, as some implementations may not support all available types, and may alias one type to another, in which case they are subtypes of one another.
The subtypep function can also determine whether a class is derived from another class. All subclasses of a class “C”, even through multiple levels or through multiple inheritance with an unrelated class, are subtypes of class “C”.
This function is somewhat esoteric in its uses. It can be used to ensure that a passed parameter is of the correct type for the actions that are about to be attempted on it, or in other branching contexts. Contexts where you might use typecase could possible be amenable to the use of subtypep.