mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-05 22:20:24 -08:00
; * lisp/subr.el: Fix comment level.
This commit is contained in:
parent
55d41f5d2b
commit
fba8b3dfb0
1 changed files with 27 additions and 27 deletions
54
lisp/subr.el
54
lisp/subr.el
|
|
@ -2757,33 +2757,33 @@ Affects only hooks run in the current buffer."
|
||||||
,@body)))
|
,@body)))
|
||||||
|
|
||||||
;;; `if-let*' and friends.
|
;;; `if-let*' and friends.
|
||||||
;;;
|
;;
|
||||||
;;; We considered adding a `cond-let*' in late 2025:
|
;; We considered adding a `cond-let*' in late 2025:
|
||||||
;;; <https://lists.gnu.org/archive/html/emacs-devel/2025-09/msg00058.html>.
|
;; <https://lists.gnu.org/archive/html/emacs-devel/2025-09/msg00058.html>.
|
||||||
;;; We decided to add the `bind-and*' clause type to `cond*' instead.
|
;; We decided to add the `bind-and*' clause type to `cond*' instead.
|
||||||
;;; At first it seems simple to extend `if-let*'/`when-let*'/`and-let*'
|
;; At first it seems simple to extend `if-let*'/`when-let*'/`and-let*'
|
||||||
;;; to `cond', but the extension is not unambiguous: there are multiple
|
;; to `cond', but the extension is not unambiguous: there are multiple
|
||||||
;;; useful, incompatible ways to do it.
|
;; useful, incompatible ways to do it.
|
||||||
;;; In particular, it quickly becomes clear that one wants clauses that
|
;; In particular, it quickly becomes clear that one wants clauses that
|
||||||
;;; only establish bindings for proceeding clauses, instead of exiting
|
;; only establish bindings for proceeding clauses, instead of exiting
|
||||||
;;; the `cond-let*'. But then
|
;; the `cond-let*'. But then
|
||||||
;;; - Should these bindings be just like in `let*', or like in
|
;; - Should these bindings be just like in `let*', or like in
|
||||||
;;; `if-let*'? In other words, should it be that if a binding
|
;; `if-let*'? In other words, should it be that if a binding
|
||||||
;;; evaluates to nil we skip the remaining bindings (bind them all to
|
;; evaluates to nil we skip the remaining bindings (bind them all to
|
||||||
;;; nil)? Both ways of doing it seem useful.
|
;; nil)? Both ways of doing it seem useful.
|
||||||
;;; - The parentheses quickly pile up. How can we avoid the programmer
|
;; - The parentheses quickly pile up. How can we avoid the programmer
|
||||||
;;; having to count parentheses? Some propose using square brackets
|
;; having to count parentheses? Some propose using square brackets
|
||||||
;;; (i.e., vectors) for the binding-only clauses, but Emacs Lisp is a
|
;; (i.e., vectors) for the binding-only clauses, but Emacs Lisp is a
|
||||||
;;; traditional Lisp which uses exclusively parentheses for control
|
;; traditional Lisp which uses exclusively parentheses for control
|
||||||
;;; constructs. Therefore, introducing square brackets here would be
|
;; constructs. Therefore, introducing square brackets here would be
|
||||||
;;; jarring to read. Another option would be to use symbols at the
|
;; jarring to read. Another option would be to use symbols at the
|
||||||
;;; beginning of clauses, like `cond*' does.
|
;; beginning of clauses, like `cond*' does.
|
||||||
;;; Whichever way one goes, the resulting macro ends up complicated,
|
;; Whichever way one goes, the resulting macro ends up complicated,
|
||||||
;;; with a substantial learning burden. Adding `bind-and*' clauses to
|
;; with a substantial learning burden. Adding `bind-and*' clauses to
|
||||||
;;; `cond*' gives us the desired functionality, and does not make
|
;; `cond*' gives us the desired functionality, and does not make
|
||||||
;;; `cond*' much more complicated. In other words, `cond*' is already
|
;; `cond*' much more complicated. In other words, `cond*' is already
|
||||||
;;; complicated, and one complicated `cond'-extending macro is better
|
;; complicated, and one complicated `cond'-extending macro is better
|
||||||
;;; than two. --spwhitton
|
;; than two. --spwhitton
|
||||||
|
|
||||||
(defun internal--build-binding (binding prev-var)
|
(defun internal--build-binding (binding prev-var)
|
||||||
"Check and build a single BINDING with PREV-VAR."
|
"Check and build a single BINDING with PREV-VAR."
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue