Chapter 14. Strings

14.1. String types & Unicode
14.2. C Reference
Base string constructors — Building strings for C data
String accessors — Reading and writing characters into a string
Strings C dictionary — Common Lisp and C equivalence

14.1. String types & Unicode

The ECL implementation of strings is ANSI Common-Lisp compliant. There are basically four string types as shown in Table 14.1. As explained in Chapter 11, when Unicode support is disabled, character and base-character are the same type and the last two string types are equivalent to the first two.

Table 14.1. Common Lisp string types

AbbreviationExpanded typeRemarks
string(array character (*))8 or 32 bits per character, adjustable.
simple-string(simple-array character (*))8 or 32 bits per character, not adjustable nor displaced.
base-string(array base-char (*))8 bits per character, adjustable.
simple-base-string(simple-array base-char (*))8 bits per character, not adjustable nor displaced.

It is important to remember that strings with unicode characters can only be printed readably when the external format supports those characters. If this is not the case, ECL will signal a serious-condition. This condition will abort your program if not properly handled.