4.5 Type Specifiers That Specialize

Some type specifier lists denote specializations of data types named by symbols. These specializations may be reflected by more efficient representations in the underlying implementation. As an example, consider the type (array short-float). Implementation A may choose to provide a specialized representation for arrays of short floating-point numbers, and implementation B may choose not to.

If you should want to create an array for the express purpose of holding only short-float objects, you may optionally specify to make-array the element type short-float. This does not require make-array to create an object of type (array short-float); it merely permits it. The request is construed to mean “Produce the most specialized array representation capable of holding short-floats that the implementation can provide.” Implementation A will then produce a specialized array of type (array short-float), and implementation B will produce an ordinary array of type (array t).

If one were then to ask whether the array were actually of type (array short-float), implementation A would say “yes,” but implementation B would say “no.” This is a property of make-array and similar functions: what you ask for is not necessarily what you get.

X3J13 voted in January 1989 to eliminate the differing treatment of types when used “for discrimination” rather than “for declaration” on the grounds that implementors have not treated the distinction consistently and (which is more important) users have found the distinction confusing.

As a consequence of this change, the behavior of typep and subtypep on array and complex type specifiers must be modified. See the descriptions of those functions. In particular, under their new behavior, implementation B would say “yes,” agreeing with implementation A, in the discussion above.

Note that the distinction between declaration and discrimination remains useful, if only so that we may remark that the specialized (list) form of the function type specifier may still be used only for declaration and not for discrimination.

X3J13 voted in June 1988 to clarify that while the specialized form of the function type specifier (a list of the symbol function possibly followed by argument and value type specifiers) may be used only for declaration, the symbol form (simply the name function) may be used for discrimination.

The valid list-format names for data types are as follows: