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/special-forms.html | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 devdocs/elisp/special-forms.html (limited to 'devdocs/elisp/special-forms.html') 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 @@ +

Special Forms

A special form 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.

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.

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, ((lambda (x) x . 3) 4) contains a subexpression that begins with lambda but is not a well-formed lambda expression, so Emacs may signal an error, or may return 3 or 4 or nil, or may behave in other ways.

Function: special-form-p object +

This predicate tests whether its argument is a special form, and returns t if so, nil otherwise.

+

Here is a list, in alphabetical order, of all of the special forms in Emacs Lisp with a reference to where each is described.

and
+

see Combining Conditions

catch
+

see Catch and Throw

cond
+

see Conditionals

condition-case
+

see Handling Errors

defconst
+

see Defining Variables

defvar
+

see Defining Variables

function
+

see Anonymous Functions

if
+

see Conditionals

interactive
+

see Interactive Call

lambda
+

see Lambda Expressions

let
let*
+

see Local Variables

or
+

see Combining Conditions

prog1
prog2
progn
+

see Sequencing

quote
+

see Quoting

save-current-buffer
+

see Current Buffer

save-excursion
+

see Excursions

save-restriction
+

see Narrowing

setq
+

see Setting Variables

setq-default
+

see Creating Buffer-Local

unwind-protect
+

see Nonlocal Exits

while

see Iteration

Common Lisp note: Here are some comparisons of special forms in GNU Emacs Lisp and Common Lisp. setq, if, and catch are special forms in both Emacs Lisp and Common Lisp. save-excursion is a special form in Emacs Lisp, but doesn’t exist in Common Lisp. throw 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).

+
+

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

+
-- cgit v1.2.3