A string, both in Common-Lisp and in ECL is nothing but a vector of
characters. Therefore, almost everything mentioned in the section of arrays
remains valid here. The only important difference is that ECL stores
strings as a lisp object with a pointer to a zero terminated C string. Thus, if
a string has
n characters, ECL will reserve
n+1 bytes for the
string. This allows us to pass the string
self pointer to any C
x is a lisp object of type string, we can access the following fields:
Maximum number of characters that it can contain.
Actual number of characters in the string.
Pointer to the characters.
Both routines build a lisp string from a C string.
make_string_copyallocates new space and copies the content of the string to it.
make_simple_stringsimply uses the memory pointed by
s, which should not be deallocated. Both routines use
strlento calculate the length of the string.