coerce
(coerce object result-type)
Converts object to the given sequence or float type. result-type may be 'list, 'vector, 'string (and their simple-/base- spellings), a compound spec such as '(vector t) or '(string 8), a float type ('float, 'single-float, 'double-float, 'short-float, 'long-float -- all the one double representation), or t (the identity). A COMPUTED result type is accepted too and dispatches at runtime over exactly those families, so an expression like (coerce seq type) with type in a variable behaves the same as the literal form. A 'string result requires a sequence of characters, and a value already of the requested type is returned unchanged. coerce is not a first-class function value (#'coerce is unavailable), so call it directly.
A vector result-type spelling an (unsigned-byte 8), (unsigned-byte 16) or (unsigned-byte 32) element type -- '(vector (unsigned-byte 8)), '(simple-array (unsigned-byte 32) (*)) -- builds a specialized vector of that element type, the same representation make-array and concatenate produce, so array-element-type reports it and typep against the matching simple-array specifier answers true. Elements are stored masked to the element width. Any other element type builds a general vector, whose element type is t. This is the spelling a lookup table usually takes, and a table whose elements are all literals is built at compile time on the compiled backends.