[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: |
Mon, 21 Jun 2021 02:29:37 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Jean Louis wrote:
> Not like that, you have to use `copy-sequence' on the last
> element within `append'
>
> (progn
> (setq list-head '(1))
> (setq list-tail '(2 3 4))
> (setq whole-list (append list-head (copy-sequence list-tail)))
> (setcdr list-tail '(3.5 4))
> whole-list
> ) ; (1 2 3 4)
Clearly doesn't work:
(progn
(setq list-head '(1))
(setq list-tail '(2 3 4))
(setq whole-list (append list-head
`(,(car list-tail))
(setcdr (copy-sequence list-tail) '(3.5 4))))
whole-list
) ; (1 2 3.5 4)
--
underground experts united
https://dataswamp.org/~incal
- Re: [External] : Re: Appending lists, (continued)
- Re: [External] : Re: Appending lists, Jean Louis, 2021/06/20
- Re: [External] : Re: Appending lists, Emanuel Berg, 2021/06/20
- Re: [External] : Re: Appending lists, Emanuel Berg, 2021/06/20
- Re: [External] : Re: Appending lists, Emanuel Berg, 2021/06/20
- Re: [External] : Re: Appending lists, Jean Louis, 2021/06/20
- Re: [External] : Re: Appending lists, Emanuel Berg, 2021/06/20
- Re: [External] : Re: Appending lists, Jean Louis, 2021/06/20
- Re: [External] : Re: Appending lists,
Emanuel Berg <=
- Re: [External] : Re: Appending lists, Jean Louis, 2021/06/20
- Re: [External] : Re: Appending lists, Stefan Monnier, 2021/06/20
- Re: [External] : Re: Appending lists, Emanuel Berg, 2021/06/20
- Re: [External] : Re: Appending lists, Emanuel Berg, 2021/06/20