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.
This commit is contained in:
Stefan Kangas 2023-09-26 18:13:00 +02:00
parent 72cc9cf2cd
commit 71feee7930

View file

@ -60,7 +60,7 @@
;; the variables of the outer one. You can, however, access alists ;; the variables of the outer one. You can, however, access alists
;; inside the original alist by using dots inside the symbol, as ;; inside the original alist by using dots inside the symbol, as
;; displayed in the example above by the `.site.contents'. ;; displayed in the example above by the `.site.contents'.
;;
;;; Code: ;;; Code:
@ -139,7 +139,14 @@ essentially expands to
If you nest `let-alist' invocations, the inner one can't access If you nest `let-alist' invocations, the inner one can't access
the variables of the outer one. You can, however, access alists the variables of the outer one. You can, however, access alists
inside the original alist by using dots inside the symbol, as 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)) (declare (indent 1) (debug t))
(let ((var (make-symbol "alist"))) (let ((var (make-symbol "alist")))
`(let ((,var ,alist)) `(let ((,var ,alist))