diff options
Diffstat (limited to 'devdocs/elisp/special-forms.html')
| -rw-r--r-- | devdocs/elisp/special-forms.html | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/devdocs/elisp/special-forms.html b/devdocs/elisp/special-forms.html new file mode 100644 index 00000000..84915e63 --- /dev/null +++ b/devdocs/elisp/special-forms.html @@ -0,0 +1,29 @@ + <h4 class="subsection">Special Forms</h4> <p>A <em>special form</em> is a primitive function specially marked so that its arguments are not all evaluated. Most special forms define control structures or perform variable bindings—things which functions cannot do. </p> <p>Each special form has its own rules for which arguments are evaluated and which are used without evaluation. Whether a particular argument is evaluated may depend on the results of evaluating other arguments. </p> <p>If an expression’s first symbol is that of a special form, the expression should follow the rules of that special form; otherwise, Emacs’s behavior is not well-defined (though it will not crash). For example, <code>((lambda (x) x . 3) 4)</code> contains a subexpression that begins with <code>lambda</code> but is not a well-formed <code>lambda</code> expression, so Emacs may signal an error, or may return 3 or 4 or <code>nil</code>, or may behave in other ways. </p> <dl> <dt id="special-form-p">Function: <strong>special-form-p</strong> <em>object</em> +</dt> <dd><p>This predicate tests whether its argument is a special form, and returns <code>t</code> if so, <code>nil</code> otherwise. </p></dd> +</dl> <p>Here is a list, in alphabetical order, of all of the special forms in Emacs Lisp with a reference to where each is described. </p> <dl compact> <dt><code>and</code></dt> <dd> +<p>see <a href="combining-conditions">Combining Conditions</a> </p> </dd> <dt><code>catch</code></dt> <dd> +<p>see <a href="catch-and-throw">Catch and Throw</a> </p> </dd> <dt><code>cond</code></dt> <dd> +<p>see <a href="conditionals">Conditionals</a> </p> </dd> <dt><code>condition-case</code></dt> <dd> +<p>see <a href="handling-errors">Handling Errors</a> </p> </dd> <dt><code>defconst</code></dt> <dd> +<p>see <a href="defining-variables">Defining Variables</a> </p> </dd> <dt><code>defvar</code></dt> <dd> +<p>see <a href="defining-variables">Defining Variables</a> </p> </dd> <dt><code>function</code></dt> <dd> +<p>see <a href="anonymous-functions">Anonymous Functions</a> </p> </dd> <dt><code>if</code></dt> <dd> +<p>see <a href="conditionals">Conditionals</a> </p> </dd> <dt><code>interactive</code></dt> <dd> +<p>see <a href="interactive-call">Interactive Call</a> </p> </dd> <dt><code>lambda</code></dt> <dd> +<p>see <a href="lambda-expressions">Lambda Expressions</a> </p> </dd> <dt><code>let</code></dt> <dt><code>let*</code></dt> <dd> +<p>see <a href="local-variables">Local Variables</a> </p> </dd> <dt><code>or</code></dt> <dd> +<p>see <a href="combining-conditions">Combining Conditions</a> </p> </dd> <dt><code>prog1</code></dt> <dt><code>prog2</code></dt> <dt><code>progn</code></dt> <dd> +<p>see <a href="sequencing">Sequencing</a> </p> </dd> <dt><code>quote</code></dt> <dd> +<p>see <a href="quoting">Quoting</a> </p> </dd> <dt><code>save-current-buffer</code></dt> <dd> +<p>see <a href="current-buffer">Current Buffer</a> </p> </dd> <dt><code>save-excursion</code></dt> <dd> +<p>see <a href="excursions">Excursions</a> </p> </dd> <dt><code>save-restriction</code></dt> <dd> +<p>see <a href="narrowing">Narrowing</a> </p> </dd> <dt><code>setq</code></dt> <dd> +<p>see <a href="setting-variables">Setting Variables</a> </p> </dd> <dt><code>setq-default</code></dt> <dd> +<p>see <a href="creating-buffer_002dlocal">Creating Buffer-Local</a> </p> </dd> <dt><code>unwind-protect</code></dt> <dd> +<p>see <a href="nonlocal-exits">Nonlocal Exits</a> </p> </dd> <dt><code>while</code></dt> <dd><p>see <a href="iteration">Iteration</a> </p></dd> </dl> <blockquote> <p><b>Common Lisp note:</b> Here are some comparisons of special forms in GNU Emacs Lisp and Common Lisp. <code>setq</code>, <code>if</code>, and <code>catch</code> are special forms in both Emacs Lisp and Common Lisp. <code>save-excursion</code> is a special form in Emacs Lisp, but doesn’t exist in Common Lisp. <code>throw</code> is a special form in Common Lisp (because it must be able to throw multiple values), but it is a function in Emacs Lisp (which doesn’t have multiple values). </p> +</blockquote><div class="_attribution"> + <p class="_attribution-p"> + Copyright © 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/Special-Forms.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Special-Forms.html</a> + </p> +</div> |
