help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [External] : Re: Appending lists


From: Emanuel Berg
Subject: Re: [External] : Re: Appending lists
Date: Sun, 20 Jun 2021 22:22:38 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Jean Louis wrote:

> (setq appended (append list-a list-b)) ⇒ (1 2 3 a b c)
>
> and nothing changed in those:
>
> list-a ⇒ (1 2 3)
> list-b ⇒ (a b c)
>
> while using function `nconc' would give me a habit that I rather find
> detrimental or not pleasing:
>
> (nconc appended list-a list-b) ⇒ (1 2 3 a b c 1 2 3 a b c . #6)
> list-a ⇒ (1 2 3 a b c 1 2 3 a b c . #6)
> list-b ⇒ (a b c 1 2 3 a b c 1 2 3 . #6)
>
> Question is why do I need to change other lists if all what
> I want is to set the first variable `appended' to
> someting new?

We have been thru this already, the destructive update is what
`nconc' does and one should use it when that's what is
desired...

> So if I don't need to change other variables I will not use
> `nconc' and rather use function `append'

They do different things, and I want both please...

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]