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

From: Howard Melman <[email-masked]>
Date: Sun, 23 Feb 2025 12:57:31 -0500

Stefan Monnier via "Bug reports for GNU Emacs, the Swiss
army knife of text editors" <[email-masked]> writes:

>> 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.

I like these for the case where something returns a sequence
and the documentation (particularly docstrings) refers to
"the third element is...". In this situation, nth being
zero-indexed makes off-by-one errors more likely.

-- 

Howard