[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [External] : Re: Easy to add with push but not to the end of a list
From: |
Drew Adams |
Subject: |
RE: [External] : Re: Easy to add with push but not to the end of a list |
Date: |
Mon, 28 Nov 2022 21:56:48 +0000 |
> I agree there should be such a function in vanilla Emacs.
> Maybe something like this?
>
> (defun push-last (elem lst)
> (when (listp lst)
> (setcdr (last lst) (list elem))
> lst))
As I said, there are umpteen different meanings /
behaviors for "add an element to the end of a list".
(setcdr (last lst) (list elem)) is one such behavior.
And that's just as succinct as (push-last elem lst),
and clearer. It makes crystal clear that you're
opting for list modification.
- Re: Easy to add with push but not to the end of a list, (continued)
- Re: Easy to add with push but not to the end of a list, Marcin Borkowski, 2022/11/29
- Re: Easy to add with push but not to the end of a list, tomas, 2022/11/29
- Re: Easy to add with push but not to the end of a list, Dr Rainer Woitok, 2022/11/29
- Of cars and mice [was: Easy to add with push but not to the end of a list], tomas, 2022/11/29
- Re: Of cars and mice [was: Easy to add with push but not to the end of a list], Emanuel Berg, 2022/11/30
- Re: Easy to add with push but not to the end of a list, Emanuel Berg, 2022/11/30
- Re: Easy to add with push but not to the end of a list, Emanuel Berg, 2022/11/30
- Re: Easy to add with push but not to the end of a list, Emanuel Berg, 2022/11/30
- Re: Easy to add with push but not to the end of a list, Emanuel Berg, 2022/11/30
Re: Easy to add with push but not to the end of a list, Emanuel Berg, 2022/11/28
- RE: [External] : Re: Easy to add with push but not to the end of a list,
Drew Adams <=
Re: Easy to add with push but not to the end of a list, Dr Rainer Woitok, 2022/11/29
Re: Easy to add with push but not to the end of a list, Michael Heerdegen, 2022/11/30