From 71feee79309b66a7baf7847472ccebf019d2a801 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 26 Sep 2023 18:13:00 +0200 Subject: [PATCH] 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)) -- 2.39.2