From: Stefan Kangas Date: Tue, 26 Sep 2023 16:13:00 +0000 (+0200) Subject: Doc fix in let-alist for keys with nil value X-Git-Tag: emacs-29.1.90~45 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=71feee79309b66a7baf7847472ccebf019d2a801;p=emacs.git 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. --- 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))