String types are supplied which are capable of holding each of the character types mentioned above. The following string types are defined:
holds any simple-char
In particular, text-string is the type that can hold all characters used in texts. The types above include non-simple strings - those which are displaced, adjustable or with a fill-pointer.
The Common Lisp type
string itself is dependent on the value of
*default-character-element-type* according to the rules for string construction described in String Construction. For example:
CL-USER 1 > (set-default-character-element-type 'base-char)
BASE-CHAR
CL-USER 2 > (coerce (list #\Ideographic-Space) 'string)
Error: In a call to SEQ::%SET-ACCESS-ARRAY: #\Ideographic-Space is not of type BASE-CHAR.
1 (abort) Return to level 0.
2 Return to top loop level 0.
Type :b for backtrace, :c <option number> to proceed, or :? for other options
CL-USER 3 : 1 > :a
CL-USER 4 > (set-default-character-element-type 'simple-char)
SIMPLE-CHAR
CL-USER 5 > (coerce (list #\Ideographic-Space) 'string)
" "
The following types are subtypes of
simple-string.
Note that in the names of the string types, 'simple' refers to the string object and does not mean that the string's elements are
simple-char
s.
The Common Lisp type
simple-string
itself is dependent on the value of *default-character-element-type* according to the rules for string construction described in String Construction.