[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-29 71feee79309 2/2: Doc fix in let-alist for keys with nil value
From: |
Stefan Kangas |
Subject: |
emacs-29 71feee79309 2/2: Doc fix in let-alist for keys with nil value |
Date: |
Thu, 28 Sep 2023 18:28:40 -0400 (EDT) |
branch: emacs-29
commit 71feee79309b66a7baf7847472ccebf019d2a801
Author: Stefan Kangas <stefankangas@gmail.com>
Commit: Stefan Kangas <stefankangas@gmail.com>
Doc fix in let-alist for keys with nil value
* lisp/emacs-lisp/let-alist.el (let-alist): Clarify that keys with a
nil value will give the same result as if they were missing.
---
lisp/emacs-lisp/let-alist.el | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/lisp/emacs-lisp/let-alist.el b/lisp/emacs-lisp/let-alist.el
index d9ad46b2af7..1f08cc41a5c 100644
--- a/lisp/emacs-lisp/let-alist.el
+++ b/lisp/emacs-lisp/let-alist.el
@@ -60,7 +60,7 @@
;; the variables of the outer one. You can, however, access alists
;; inside the original alist by using dots inside the symbol, as
;; displayed in the example above by the `.site.contents'.
-;;
+
;;; Code:
@@ -139,7 +139,14 @@ essentially expands to
If you nest `let-alist' invocations, the inner one can't access
the variables of the outer one. You can, however, access alists
inside the original alist by using dots inside the symbol, as
-displayed in the example above."
+displayed in the example above.
+
+Note that there is no way to differentiate the case where a key
+is missing from when it is present, but its value is nil. Thus,
+the following form evaluates to nil:
+
+ (let-alist '((some-key . nil))
+ .some-key)"
(declare (indent 1) (debug t))
(let ((var (make-symbol "alist")))
`(let ((,var ,alist))