help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Advantage using mapc over dolist


From: Tomas Hlavaty
Subject: Re: Advantage using mapc over dolist
Date: Tue, 03 Dec 2024 21:35:28 +0100

On Tue 03 Dec 2024 at 11:47, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> Richard was strongly opposed to the use of the CL package because of its
> "stepping" all over the ELisp namespace.  For years, this manifested
> itself in the fact that use of CL within Emacs's own code was generally
> shunned and tolerated only with (eval-when-compile (require 'cl)),
> meaning that you could use CL only when it could be compiled away during
> byte-compilation (by macro-expansion and/or inlining).  So you could use
> `ecase` but not `some`.

How did you decide what should be renamed to cl-*?

Don't you think you overdone it, that too much was renamed?

Why was IF not renamed to cl-if?

Why do you think CASE is CL?

> While some people were happy because they consider that ELisp is better
> off without those Common Lisp constructs

How do you feel about code like this?

(defun tempo-is-user-element (element)
  "Try all the user-defined element handlers in `tempo-user-elements'."
  ;; Sigh... I need (some list)
  (catch 'found
    (mapc (lambda (handler)
            (let ((result (funcall handler element)))
              (if result (throw 'found result))))
          tempo-user-elements)
    (throw 'found nil)))

Do you think duplicating SOME this way is better than embracing SOME?

> Note that if you really really hate using these extra three letters, you
> can still (require 'cl).  It's deprecated and may be removed from Emacs in
> some future release, but it's a very simple library so you can keep your
> own copy (and we may even put it up on GNU ELPA anyway).

In my code I just require cl-lib and add the cl- prefix where needed and
live with that.

But here we are discussing Emacs code, the way it is evolving and the
future problems it will bring.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]