Subject: bug#76476: closed (Re: bug#76476: Make cl-first, cl-second, ..., cl-tenth part of Emacs Lisp)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 24 Feb 2025 16:34:02 +0000

Your bug report

#76476: Make cl-first, cl-second, ..., cl-tenth part of Emacs Lisp

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
76476: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=76476
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#76476: Make cl-first, cl-second, ..., cl-tenth part of Emacs Lisp
From: Stefan Kangas <[email-masked]>
To: [email-masked], Stefan Monnier <[email-masked]>
Cc: [email-masked], [email-masked], [email-masked]
Date: Mon, 24 Feb 2025 16:33:41 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Richard Stallman <[email-masked]> writes:

>   > >     first
>   > >     second
>   > >     third
>   > >     fourth
>   > >     fifth
>   > >     sixth
>   > >     seventh
>   > >     eight
>   > >     ninth
>   > >     tenth
>   > >     rest
>
>   > FWIW, I hate those even more than the `cadar` thingies.  🙂
>
> I agree -- most of these are no improvement.  They don't make programs
> simpler.
>
> We no longer have a need to strain to keep the number of function
> names in GNU Emacs as small as possible.  But that doesn't mean
> we should add every function that could be meaningful.
> Some meaningful functions are not worth the work of documenting them.

Thanks.  It appears that this change isn't gaining much support.

I'm therefore closing this bug report now.

Subject: Make cl-first, cl-second, ..., cl-tenth part of Emacs Lisp
From: Stefan Kangas <[email-masked]>
To: [email-masked]
Date: Fri, 21 Feb 2025 18:40:46 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Severity: wishlist

I propose making the following functions from cl-lib.el a part of
Emacs Lisp proper (i.e. defined in subr.el):

    first
    second
    third
    fourth
    fifth
    sixth
    seventh
    eight
    ninth
    tenth
    rest

This would allow converting code such as:

    (mapcar (lambda (thing) (car (cdr (cdr (cdr thing))))) ...)
    (mapcar (lambda (thing) (cadddr thing)) ...)
    (mapcar (lambda (thing) (nth 3 thing)) ...)

to the IMHO, more direct and readable:

    (mapcar #'fourth ...)

I'm adding `rest' to the list as well, as the natural corollary to
`first'.

Which would be used is obviously situational, and should be left to
whoever is touching that code.  There is no general need to "upgrade"
old code to prefer these new functions.

Thoughts?