GNU bug report logs - #76476
Make cl-first, cl-second, ..., cl-tenth part of Emacs Lisp

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefankangas <at> gmail.com>

Date: Fri, 21 Feb 2025 18:42:02 UTC

Severity: wishlist

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 76476 <at> debbugs.gnu.org, eliz <at> gnu.org, acorallo <at> gnu.org
Subject: bug#76476: Make cl-first, cl-second, ..., cl-tenth part of Emacs Lisp
Date: Fri, 21 Feb 2025 17:30:50 -0500
> 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

FWIW, I hate those even more than the `cadar` thingies.  🙂

For direct calls, `nth` is always a better choice (except for `first`
and `rest`, of course, where `car/cdr` would be the replacement), so the
only use case is when you pass them as arg somewhere, but that doesn't
seem to be very frequent.
[ And for those rare cases, an approach like llama's (##nth N %) is
  a more general solution to the problem.  ]


        Stefan





This bug report was last modified 143 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.