LispWorks User Guide and Reference Manual > 22 Internationalization > 22.2 Character and String types

NextPrevUpTopContentsIndex

22.2.3 String types

String types are supplied which are capable of holding each of the character types mentioned above. The following string types are defined:

base-string

holds any base-char

text-string

holds any simple-char

augmented-string

holds any character .

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.

simple-base-string

holds any base-char

simple-text-string

holds any simple-char

simple-augmented-string

holds any character.

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.

22.2.3.1 String types at runtime

22.2.3.2 String types at compile time


LispWorks User Guide and Reference Manual - 22 Dec 2009

NextPrevUpTopContentsIndex