Next: Byte Vectors, Previous: Modification of Strings, Up: Strings
MIT/GNU Scheme allows the length of a string to be dynamically adjusted in a
limited way. When a new string is allocated, by whatever method, it has
a specific length. At the time of allocation, it is also given a
maximum length, which is guaranteed to be at least as large as the
string's length. (Sometimes the maximum length will be slightly larger
than the length, but it is a bad idea to count on this. Programs should
assume that the maximum length is the same as the length at the time of
the string's allocation.) After the string is allocated, the operation
set-string-length!
can be used to alter the string's length to
any value between 0 and the string's maximum length, inclusive.