Type base-char

Supertypes:

base-char, character, t

Description:

The type base-char is defined as the upgraded array element type of standard-char. An implementation can support additional subtypes of type character (besides the ones listed in this standard) that might or might not be supertypes of type base-char. In addition, an implementation can define base-char to be the same type as character.

Base characters are distinguished in the following respects:

The distinction of base characters is largely a pragmatic choice. It permits efficient handling of common situations, may be privileged for host system I/O, and can serve as an intermediate basis for portability, less general than the standard characters, but possibly more useful across a narrower range of implementations. Many computers have some "base" character representation which is a function of hardware instructions for dealing with characters, as well as the organization of the file system. The base character representation is likely to be the smallest transaction unit permitted for text file and terminal I/O operations. On a system with a record based I/O paradigm, the base character representation is likely to be the smallest record quantum. On many computer systems, this representation is a byte.

Whether a character is a base character depends on the way that an implementation represents strings, and not any other properties of the implementation or the host operating system. For example, one implementation might encode all strings as characters having 16-bit encodings, and another might have two kinds of strings: those with characters having 8-bit encodings and those with characters having 16-bit encodings. In the first implementation, the type base-char is equivalent to the type character: there is only one kind of string. In the second implementation, the base characters might be those characters that could be stored in a string of characters having 8-bit encodings. In such an implementation, the type base-char is a proper subtype of the type character. KMP: Note that I think there could be implementations in which the 8-bit strings are -not- base characters, if all the standard-chars were not representable using the 8-bit encoding scheme. In such a case, it might be that (upgraded-array-element-type 'standard-char) returned the 16-bit representation. It might be that the 8-bit representation was something else entirely.

2.15.0 15The type standard-char is a subtype of type base-char. This text will be deleted: subtype of \typeref{character}. \thetype{string-char} is a \subtypeof{character}.