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/sequences-arrays-vectors.html | 63 +++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 devdocs/elisp/sequences-arrays-vectors.html (limited to 'devdocs/elisp/sequences-arrays-vectors.html') diff --git a/devdocs/elisp/sequences-arrays-vectors.html b/devdocs/elisp/sequences-arrays-vectors.html new file mode 100644 index 00000000..f4fdbba6 --- /dev/null +++ b/devdocs/elisp/sequences-arrays-vectors.html @@ -0,0 +1,63 @@ +

Sequences, Arrays, and Vectors

The sequence type is the union of two other Lisp types: lists and arrays. In other words, any list is a sequence, and any array is a sequence. The common property that all sequences have is that each is an ordered collection of elements.

An array is a fixed-length object with a slot for each of its elements. All the elements are accessible in constant time. The four types of arrays are strings, vectors, char-tables and bool-vectors.

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 nth element requires looking through n cons cells, so elements farther from the beginning of the list take longer to access. But it is possible to add elements to the list, or remove elements.

The following diagram shows the relationship between these types:

          _____________________________________________
+         |                                             |
+         |          Sequence                           |
+         |  ______   ________________________________  |
+         | |      | |                                | |
+         | | List | |             Array              | |
+         | |      | |    ________       ________     | |
+         | |______| |   |        |     |        |    | |
+         |          |   | Vector |     | String |    | |
+         |          |   |________|     |________|    | |
+         |          |  ____________   _____________  | |
+         |          | |            | |             | | |
+         |          | | Char-table | | Bool-vector | | |
+         |          | |____________| |_____________| | |
+         |          |________________________________| |
+         |_____________________________________________|
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ 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/Sequences-Arrays-Vectors.html +

+
-- cgit v1.2.3