From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/elisp/arrays.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 devdocs/elisp/arrays.html (limited to 'devdocs/elisp/arrays.html') diff --git a/devdocs/elisp/arrays.html b/devdocs/elisp/arrays.html new file mode 100644 index 00000000..06d89c76 --- /dev/null +++ b/devdocs/elisp/arrays.html @@ -0,0 +1,14 @@ +

Arrays

An array object has slots that hold a number of other Lisp objects, called the elements of the array. Any element of an array may be accessed in constant time. In contrast, the time to access an element of a list is proportional to the position of that element in the list.

Emacs defines four types of array, all one-dimensional: strings (see String Type), vectors (see Vector Type), bool-vectors (see Bool-Vector Type), and char-tables (see Char-Table Type). Vectors and char-tables can hold elements of any type, but strings can only hold characters, and bool-vectors can only hold t and nil.

All four kinds of array share these characteristics:

When you create an array, other than a char-table, you must specify its length. You cannot specify the length of a char-table, because that is determined by the range of character codes.

In principle, if you want 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:

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. See Key Sequence Input.

+

+ Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc.
Licensed under the GNU GPL license.
+ https://www.gnu.org/software/emacs/manual/html_node/elisp/Arrays.html +

+
-- cgit v1.2.3