summaryrefslogtreecommitdiff
path: root/doc/lispref/variables.texi
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2021-09-13 11:53:18 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2021-09-13 11:53:18 +0200
commitba0be8df532a497f67bb5fc0188a0ac3c7278b39 (patch)
treeffd6da8d026f491242686ec71278b91ebaf5be11 /doc/lispref/variables.texi
parent2a3ef454c2bc1b8d21e22dc5d0e0d8b897f8187d (diff)
downloademacs-ba0be8df532a497f67bb5fc0188a0ac3c7278b39.tar.gz
Document named-let and update some NEWS tags
* doc/lispref/variables.texi (Local Variables): Document `named-let'.
Diffstat (limited to 'doc/lispref/variables.texi')
-rw-r--r--doc/lispref/variables.texi19
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index 3b0331847d3..9646daab7ad 100644
--- a/doc/lispref/variables.texi
+++ b/doc/lispref/variables.texi
@@ -302,6 +302,25 @@ Binding}), but it's impractical to @code{defvar} these variables.
the forms, and then make the variables non-special again.
@end defspec
+@defspec named-let name bindings &rest body
+This special form is like @code{let}: It binds the variables in
+@var{bindings}, and then evaluates @var{body}. However,
+@code{named-let} allows you to call @var{body} recursively by calling
+@var{name}, where the arguments passed to @var{name} are used as the
+new values of the bound variables in the recursive invocation.
+
+Here's a trivial example:
+
+@lisp
+(named-let foo
+ ((a 1)
+ (b 2))
+ (nconc (list a b)
+ (and (= a 1) (foo 3 4))))
+ @result{} (1 2 3 4)
+@end lisp
+@end defspec
+
Here is a complete list of the other facilities that create local
bindings: