emacs-devel
[Top][All Lists]
Advanced

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

Re: What's missing in ELisp that makes people want to use cl-lib?


From: Tomas Hlavaty
Subject: Re: What's missing in ELisp that makes people want to use cl-lib?
Date: Tue, 14 Nov 2023 09:13:08 +0100

On Mon 13 Nov 2023 at 21:58, Richard Stallman <rms@gnu.org> wrote:
>   >   (cl-loop
>   >    with comp-ctxt = (make-comp-cstr-ctxt)
>   >    with h = (make-hash-table :test #'eq)
>   >    for (f type-spec) in comp-known-type-specifiers
>   >    for cstr = (comp-type-spec-to-cstr type-spec)
>   >    do (puthash f cstr h)
>   >    finally return h)
> Boy that is hard to understand.

It is ugly.

> I suggest we rewrite those cl-loop calls
> into ordinary Lisp, avoiding use of cl-loop.

That would be something along the lines of:

(let ((comp-ctxt (make-comp-cstr-ctxt))
      (h (make-hash-table :test #'eq))
      f)
  (while (setq f (pop comp-known-type-specifiers))
    (puthash f (comp-type-spec-to-cstr type-spec) h))
  h)

comp-ctxt does not seem to be used.
Does emacs-lisp compiler not warn about unused variables?

> I looked at the manual for the iter construct ("iterate").  The added
> parentheses make it fit better into Lisp.

I find the idea of iterate even uglier that cl-loop
and I think that it leads people completely astray.
It is not ordinary lisp code or macro, it is a compiler.



reply via email to

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