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

Quoting

The special form quote returns its single argument, as written, without evaluating it. This provides a way to include constant symbols and lists, which are not self-evaluating objects, in a program. (It is not necessary to quote self-evaluating objects such as numbers, strings, and vectors.)

Special Form: quote object +

This special form returns object, without evaluating it. The returned value might be shared and should not be modified. See Self-Evaluating Forms.

+

Because quote is used so often in programs, Lisp provides a convenient read syntax for it. An apostrophe character (‘'’) followed by a Lisp object (in read syntax) expands to a list whose first element is quote, and whose second element is the object. Thus, the read syntax 'x is an abbreviation for (quote x).

Here are some examples of expressions that use quote:

(quote (+ 1 2))
+     ⇒ (+ 1 2)
+
+
(quote foo)
+     ⇒ foo
+
+
'foo
+     ⇒ foo
+
+
''foo
+     ⇒ 'foo
+
+
'(quote foo)
+     ⇒ 'foo
+
+
['foo]
+     ⇒ ['foo]
+
+

Although the expressions (list '+ 1 2) and '(+ 1 2) both yield lists equal to (+ 1 2), the former yields a freshly-minted mutable list whereas the latter yields a list built from conses that might be shared and should not be modified. See Self-Evaluating Forms.

Other quoting constructs include function (see Anonymous Functions), which causes an anonymous lambda expression written in Lisp to be compiled, and ‘`’ (see Backquote), which is used to quote only part of a list, while computing and substituting other parts.

+

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

+
-- cgit v1.2.3