summaryrefslogtreecommitdiff
path: root/devdocs/elisp/symbol-forms.html
diff options
context:
space:
mode:
Diffstat (limited to 'devdocs/elisp/symbol-forms.html')
-rw-r--r--devdocs/elisp/symbol-forms.html15
1 files changed, 15 insertions, 0 deletions
diff --git a/devdocs/elisp/symbol-forms.html b/devdocs/elisp/symbol-forms.html
new file mode 100644
index 00000000..7d2da9de
--- /dev/null
+++ b/devdocs/elisp/symbol-forms.html
@@ -0,0 +1,15 @@
+ <h4 class="subsection">Symbol Forms</h4> <p>When a symbol is evaluated, it is treated as a variable. The result is the variable’s value, if it has one. If the symbol has no value as a variable, the Lisp interpreter signals an error. For more information on the use of variables, see <a href="variables">Variables</a>. </p> <p>In the following example, we set the value of a symbol with <code>setq</code>. Then we evaluate the symbol, and get back the value that <code>setq</code> stored. </p> <div class="example"> <pre class="example">(setq a 123)
+ ⇒ 123
+</pre>
+<pre class="example">(eval 'a)
+ ⇒ 123
+</pre>
+<pre class="example">a
+ ⇒ 123
+</pre>
+</div> <p>The symbols <code>nil</code> and <code>t</code> are treated specially, so that the value of <code>nil</code> is always <code>nil</code>, and the value of <code>t</code> is always <code>t</code>; you cannot set or bind them to any other values. Thus, these two symbols act like self-evaluating forms, even though <code>eval</code> treats them like any other symbol. A symbol whose name starts with ‘<samp>:</samp>’ also self-evaluates in the same way; likewise, its value ordinarily cannot be changed. See <a href="constant-variables">Constant Variables</a>. </p><div class="_attribution">
+ <p class="_attribution-p">
+ Copyright &copy; 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
+ <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Symbol-Forms.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Symbol-Forms.html</a>
+ </p>
+</div>