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 17:47:32 +0100

On Tue 14 Nov 2023 at 18:55, Po Lu <luangruo@yahoo.com> wrote:
> João Távora <joaotavora@gmail.com> writes:
>
>> Every macro is a compiler: it translates arbitrary forms to Lisp 
>> forms.
>
> That's quibbling.  The transformations carried out by cl-loop are by a
> long shot more consequential to the structure of their input than those
> by most any other macro there is, which is a demerit and, I think, is
> what Thomas meant to communicate.

Yes, thanks, that was the idea.

Claiming "every macro is a compiler" is not useful for understanding,
why cl-loop or iterate are ugly.

cl-loop is ugly because it invents kind of flat (at the list level)
syntax and rewrites the top flat part.  But it does not change deeper
parts of the input.

iterate is another level of ugly.  It does not have flat syntax, but
rewrites the input all the way to the bottom of the form.  And it needs
to understand every form it walks.

I usually prefer using the simplest tool for the job.

In this example the choices could be:

   while|dolist|mapcar < cl-loop < iterate

I would use while or dolist or mapcar.
There is no point using cl-loop.  It is bearable if somebody insist.
iterate should not exist.



reply via email to

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