All Manuals > LispWorks User Guide and Reference Manual > 33 The COMMON-LISP Package

NextPrevUpTopContentsIndex

simple-string

Type
Summary

The simple string type.

Package

common-lisp

Signature

simple-string length element-type

Arguments

length

The length of the string (or *, meaning any).

element-type

The type of string element. The default is the value of *default-character-element-type* rather than *.

Description

The union of all simple string types as specified in the standard, but extended with an extra parameter: element-type.

(simple-string length element-type) means all simple string types whose element type is a subtype of element-type. That is:

(simple-string * base-char) = (vector base-char *)
(simple-string * lw:bmp-char)= (or (vector base-char *)
                                 (vector lw:bmp-char *))
(simple-string * character)  = (or (vector base-char *)
                                   (vector lw:bmp-char *)
                                   (vector character *))
Example
CL-USER 235 > (lw:set-default-character-element-type
                     'base-char)
BASE-CHAR
CL-USER 236 > (concatenate 'simple-string "f" "o" "o")
"foo"
CL-USER 237 > (type-of *)
SIMPLE-BASE-STRING
See also

*default-character-element-type*
set-default-character-element-type
string


LispWorks User Guide and Reference Manual - 20 Sep 2017

NextPrevUpTopContentsIndex