NextPrevUpTopContentsIndex

21.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

lw:text-string

holds any lw:simple-char

sys:augmented-string

holds any character.

In particular, lw: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 lw:*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 lw:simple-char s.

simple-base-string

holds any base-char

lw:simple-text-string

holds any lw:simple-char

sys: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.


LispWorks User Guide - 7 Jul 2004

NextPrevUpTopContentsIndex