GNU bug report logs -
#76476
Make cl-first, cl-second, ..., cl-tenth part of Emacs Lisp
Previous Next
Full log
View this message in rfc822 format
Stefan Monnier via "Bug reports for GNU Emacs, the Swiss
army knife of text editors" <bug-gnu-emacs <at> gnu.org> 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
This bug report was last modified 142 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.