[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Chopping the last element of a list
From: |
tomas |
Subject: |
Re: Chopping the last element of a list |
Date: |
Fri, 29 Apr 2022 07:12:38 +0200 |
On Fri, Apr 29, 2022 at 04:26:51AM +0000, emacsq wrote:
> >
> > Here. It returns the last element, and it
> > chops that last element off the list.
>
> Thanks. It's quite simple and useful to have along with last/butlast/etc.
>
> Will you put it into subr.el, so emacs has it built-in ?
Read Drew's code again. Read the examples he provided.
Now, answer this one question: for a list with exactly
one element, say
(setq foo '(1))
what is its last element? What would you expect choplast
to do? What does Drew's implementation do? Surprise?
Cheers
--
t
signature.asc
Description: PGP signature
Re: Chopping the last element of a list, Drew Adams, 2022/04/28