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/list_002drelated-predicates.html | 45 ++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 devdocs/elisp/list_002drelated-predicates.html (limited to 'devdocs/elisp/list_002drelated-predicates.html') diff --git a/devdocs/elisp/list_002drelated-predicates.html b/devdocs/elisp/list_002drelated-predicates.html new file mode 100644 index 00000000..03c7692e --- /dev/null +++ b/devdocs/elisp/list_002drelated-predicates.html @@ -0,0 +1,45 @@ +

Predicates on Lists

The following predicates test whether a Lisp object is an atom, whether it is a cons cell or is a list, or whether it is the distinguished object nil. (Many of these predicates can be defined in terms of the others, but they are used so often that it is worth having them.)

Function: consp object +

This function returns t if object is a cons cell, nil otherwise. nil is not a cons cell, although it is a list.

+
Function: atom object +
+

This function returns t if object is an atom, nil otherwise. All objects except cons cells are atoms. The symbol nil is an atom and is also a list; it is the only Lisp object that is both.

(atom object) ≡ (not (consp object))
+
+
+
Function: listp object +
+

This function returns t if object is a cons cell or nil. Otherwise, it returns nil.

(listp '(1))
+     ⇒ t
+
+
(listp '())
+     ⇒ t
+
+
+
Function: nlistp object +
+

This function is the opposite of listp: it returns t if object is not a list. Otherwise, it returns nil.

(listp object) ≡ (not (nlistp object))
+
+
+
Function: null object +
+

This function returns t if object is nil, and returns nil otherwise. This function is identical to not, but as a matter of clarity we use null when object is considered a list and not when it is considered a truth value (see not in Combining Conditions).

(null '(1))
+     ⇒ nil
+
+
(null '())
+     ⇒ t
+
+
+
Function: proper-list-p object +
+

This function returns the length of object if it is a proper list, nil otherwise (see Cons Cells). In addition to satisfying listp, a proper list is neither circular nor dotted.

(proper-list-p '(a b c))
+    ⇒ 3
+
+
(proper-list-p '(a b . c))
+    ⇒ nil
+
+
+
+

+ 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/List_002drelated-Predicates.html +

+
-- cgit v1.2.3