summaryrefslogtreecommitdiff
path: root/devdocs/elisp/simple-lambda.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2025-08-14 22:58:58 -0500
committerCraig Jennings <c@cjennings.net>2025-08-14 22:58:58 -0500
commit82ba818ff456bcd6d56a06226e3f27e98fbb55c3 (patch)
tree158cfc17b2f644a10f063cb546752cfaae12c97f /devdocs/elisp/simple-lambda.html
parent9278ddd4ea1a8b1a4c1edaa8894516e3f48d245b (diff)
downloaddotemacs-82ba818ff456bcd6d56a06226e3f27e98fbb55c3.tar.gz
dotemacs-82ba818ff456bcd6d56a06226e3f27e98fbb55c3.zip
removing all downloaded devdocs files
Diffstat (limited to 'devdocs/elisp/simple-lambda.html')
-rw-r--r--devdocs/elisp/simple-lambda.html15
1 files changed, 0 insertions, 15 deletions
diff --git a/devdocs/elisp/simple-lambda.html b/devdocs/elisp/simple-lambda.html
deleted file mode 100644
index 9543224d..00000000
--- a/devdocs/elisp/simple-lambda.html
+++ /dev/null
@@ -1,15 +0,0 @@
- <h4 class="subsection">A Simple Lambda Expression Example</h4> <p>Consider the following example: </p> <div class="example"> <pre class="example">(lambda (a b c) (+ a b c))
-</pre>
-</div> <p>We can call this function by passing it to <code>funcall</code>, like this: </p> <div class="example"> <pre class="example">(funcall (lambda (a b c) (+ a b c))
- 1 2 3)
-</pre>
-</div> <p>This call evaluates the body of the lambda expression with the variable <code>a</code> bound to 1, <code>b</code> bound to 2, and <code>c</code> bound to 3. Evaluation of the body adds these three numbers, producing the result 6; therefore, this call to the function returns the value 6. </p> <p>Note that the arguments can be the results of other function calls, as in this example: </p> <div class="example"> <pre class="example">(funcall (lambda (a b c) (+ a b c))
- 1 (* 2 3) (- 5 4))
-</pre>
-</div> <p>This evaluates the arguments <code>1</code>, <code>(* 2 3)</code>, and <code>(- 5
-4)</code> from left to right. Then it applies the lambda expression to the argument values 1, 6 and 1 to produce the value 8. </p> <p>As these examples show, you can use a form with a lambda expression as its <small>CAR</small> to make local variables and give them values. In the old days of Lisp, this technique was the only way to bind and initialize local variables. But nowadays, it is clearer to use the special form <code>let</code> for this purpose (see <a href="local-variables">Local Variables</a>). Lambda expressions are mainly used as anonymous functions for passing as arguments to other functions (see <a href="anonymous-functions">Anonymous Functions</a>), or stored as symbol function definitions to produce named functions (see <a href="function-names">Function Names</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/Simple-Lambda.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Simple-Lambda.html</a>
- </p>
-</div>