[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: append, push, and add-to-list.
From: |
Emanuel Berg |
Subject: |
Re: append, push, and add-to-list. |
Date: |
Mon, 05 Jul 2021 05:48:23 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Hongyi Zhao wrote:
> On Mon, Jul 5, 2021 at 12:19 AM Emanuel Berg via Users list for the
> GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:
>
>>
>> Hongyi Zhao wrote:
>>
>> > I've noticed there are some similar functions, i.e., append,
>> > push, and add-to-list, for revising/updating the content of
>> > a list. But I'm still not so clear on the specific use
>> > scenarios for them. Consider the following command [1]
>>
>> `nconc', `cl-pushnew', (setq lst `(,@lst el)) ...
>
> Does the following append `el' to `lst'?
>
> (setq lst `(,@lst el))
Yes, literally, but maybe it makes more sense if that is
evaluated as well?
(defvar lst)
(setq lst '(a b c))
(defvar el)
(setq el 4)
(setq lst `(,@lst ,el))
Now "lst" will be (a b c 4)
> This is one of the reasons that baffles me the most - there
> are so many functions in Emacs.
The more the merrier...
--
underground experts united
https://dataswamp.org/~incal
- Re: append, push, and add-to-list., (continued)
- Re: append, push, and add-to-list., Jean Louis, 2021/07/04
- Re: append, push, and add-to-list., Hongyi Zhao, 2021/07/04
- Re: append, push, and add-to-list., Jean Louis, 2021/07/04
- Re: append, push, and add-to-list., Hongyi Zhao, 2021/07/04
- Re: append, push, and add-to-list., Jean Louis, 2021/07/04
- Re: append, push, and add-to-list., Hongyi Zhao, 2021/07/04
- RE: [External] : Re: append, push, and add-to-list., Drew Adams, 2021/07/04
- Re: append, push, and add-to-list., Emanuel Berg, 2021/07/04
Re: append, push, and add-to-list., Emanuel Berg, 2021/07/04
- Re: append, push, and add-to-list., Hongyi Zhao, 2021/07/04
- Re: append, push, and add-to-list.,
Emanuel Berg <=
- Re: append, push, and add-to-list., Emanuel Berg, 2021/07/05
- Re: append, push, and add-to-list., Hongyi Zhao, 2021/07/05
- Re: append, push, and add-to-list., Emanuel Berg, 2021/07/05
- Re: append, push, and add-to-list., Hongyi Zhao, 2021/07/05
Re: append, push, and add-to-list., Jean Louis, 2021/07/05
Re: append, push, and add-to-list., Hongyi Zhao, 2021/07/05
Re: append, push, and add-to-list., Emanuel Berg, 2021/07/05
Re: append, push, and add-to-list., Drew Adams, 2021/07/05