[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Advantage using mapc over dolist
From: |
Heime |
Subject: |
Re: Advantage using mapc over dolist |
Date: |
Tue, 03 Dec 2024 20:12:42 +0000 |
On Wednesday, December 4th, 2024 at 8:04 AM, Tomas Hlavaty <tom@logand.com>
wrote:
> On Tue 03 Dec 2024 at 22:24, Jean Louis bugs@gnu.support wrote:
>
> > > > I am an Emacs Lisp programmer, and all Common Lisp functions
> > > > prefixed with `cl-` I find liberating in the sense that personally
> > > > within Emacs Lisp I do not like mixing it because it is not Common Lisp.
>
>
> Maybe the issue is that too many things were degraded into cl-*.
> And now very complex bad ideas are pushed as replacement fix.
>
> > > > But within Emacs, I like using Emacs Lisp pure
>
>
> Not sure what does "Emacs Lisp pure" mean.
> Does it mean "Whatever comes with Emacs except cl-* stuff."?
The cl- prefix seems to indicate this. The commands started to be explicit
that they are cl rather than elisp.
For me, it should all be lisp.
> "Emacs Lisp pure" had CASE and ECASE in 1993 (conversion to RCS
> according to git) until 2012 iirc.
>
> > But Tomas, I mentioned nothing about pcase. I said cl- namespace being
> > separate feels liberating to me as my personal choice. If you wish to
> > use those commands without cl-prefix, there is solution that Stefan
> > wrote in recent email.
>
>
> Bad workarounds do not fill me with joy.
>
> > > Anytime I process complex
> > > data recursively, I reach for labels. There does not seem to be an
> > > alternative, does it?
> >
> > I have no idea about it, let me see what AI says:
>
>
> That AI is not good enough.
> The examples are too trivial to justify labels.
>
> This function has a structure which does justify labels:
>
> (defun parse-rss (dom)
> (let (z)
> (cl-labels ((link (x)
> (when (consp x)
> (cl-case (car x)
> (link (push (caddr x) z))
> (t (mapc #'link (cddr x))))))
> (rec (x)
> (when (consp x)
> (cl-case (car x)
> (item (link x))
> (t (mapc #'rec (cddr x)))))))
> (rec dom))
> (nreverse z)))
>
> > So I would say, I would not get frustrated, rather just make an alias
> > for me and use `labels' wherever I wish and want.
>
>
> This does not address the problem.
>
> In my Elisp code, I simply require cl-lib, add those cl- prefixes where
> needed and live with the result.
>
> However, here simple and likely pre-CL functions and macros are degraded
> to cl-, people are discouraged from using cl- and encouraged to use
> something even more bonkers than cl-* ;-)
- Re: Advantage using mapc over dolist, (continued)
- Re: Advantage using mapc over dolist, Heime, 2024/12/02
- Re: Advantage using mapc over dolist, Tomas Hlavaty, 2024/12/02
- Re: Advantage using mapc over dolist, Jean Louis, 2024/12/02
- Re: Advantage using mapc over dolist, Tomas Hlavaty, 2024/12/02
- Re: Advantage using mapc over dolist, Heime, 2024/12/02
- Re: Advantage using mapc over dolist, Jean Louis, 2024/12/03
- Re: Advantage using mapc over dolist, Tomas Hlavaty, 2024/12/03
- Re: Advantage using mapc over dolist, Jean Louis, 2024/12/03
- Re: Advantage using mapc over dolist, Tomas Hlavaty, 2024/12/03
- Re: Advantage using mapc over dolist, Jean Louis, 2024/12/03
- Re: Advantage using mapc over dolist,
Heime <=
- Re: Advantage using mapc over dolist, Jean Louis, 2024/12/03
- Re: Advantage using mapc over dolist, Heime, 2024/12/02
- Re: Advantage using mapc over dolist, Jean Louis, 2024/12/03
- Re: Advantage using mapc over dolist, Heime, 2024/12/03
Re: Advantage using mapc over dolist, Stefan Monnier, 2024/12/03
- Re: Advantage using mapc over dolist, Tomas Hlavaty, 2024/12/03
- Re: Advantage using mapc over dolist, Stefan Monnier, 2024/12/03
- Re: Advantage using mapc over dolist, Alfred M. Szmidt, 2024/12/03
- Re: Advantage using mapc over dolist, Stefan Monnier, 2024/12/03
- Re: Advantage using mapc over dolist, Tomas Hlavaty, 2024/12/03