An @dfn{array} is a single primitive object that has a slot for each
elements. All the elements are accessible in constant time, but the
-length of an existing array cannot be changed. Both strings and vectors
-are arrays.
+length of an existing array cannot be changed. Strings and vectors are
+the two types of arrays.
A list is a sequence of elements, but it is not a single primitive
object; it is made of cons cells, one cell per element. Finding the
| | List | | Array | |
| | | | ________ _______ | |
| |______| | | | | | | |
- | | | String | | Vector| | |
+ | | | Vector | | String| | |
| | |________| |_______| | |
| |______________________| |
|___________________________________|
@end group
@end example
-This function duplicates @code{aref} (@pxref{Array Functions}) and
-@code{nth} (@pxref{List Elements}), except that it works for any kind of
-sequence.
+This function generalizes @code{aref} (@pxref{Array Functions}) and
+@code{nth} (@pxref{List Elements}).
@end defun
@node Arrays
@code{aref} and @code{aset}, respectively (@pxref{Array Functions}).
@end itemize
- In principle, if you wish to have an array of characters, you could use
-either a string or a vector. In practice, we always choose strings for
-such applications, for four reasons:
+ In principle, if you wish to have an array of text characters, you
+could use either a string or a vector. In practice, we always choose
+strings for such applications, for four reasons:
@itemize @bullet
@item
buffer the way you can insert a string. @xref{Strings and Characters}.
@end itemize
+ By contrast, for an array of keyboard input characters (such as a key
+sequence), a vector may be necessary, because many keyboard input
+characters are outside the range that will fit in a string. @xref{Key
+Sequence Input}.
+
@node Array Functions
@section Functions that Operate on Arrays
@end group
@end example
-When an argument is an integer (not a sequence of integers), it is
-converted to a string of digits making up the decimal printed
-representation of the integer. This special case exists for
-compatibility with Mocklisp, and we don't recommend you take advantage
-of it. If you want to convert an integer to digits in this way, use
+The @code{vconcat} function also allows integers as arguments. It
+converts them to strings of digits, making up the decimal print
+representation of the integer, and then uses the strings instead of the
+original integers. @strong{Don't use this feature; we plan to eliminate
+it. If you already use this feature, change your programs now!} The
+proper way to convert an integer to a decimal number in this way is with
@code{format} (@pxref{Formatting Strings}) or @code{number-to-string}
(@pxref{String Conversion}).