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

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

Re: Appending lists


From: Emanuel Berg
Subject: Re: Appending lists
Date: Tue, 15 Jun 2021 02:56:16 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Pierpaolo Bernardi wrote:

> (defvar newlist 
>     (append city district))

Looks - bad.

Forget about the initvalue, here people will have to agree to
disagree tho. It makes development less "athletic" and fun,
and more confusing when debugging/optimization and so re-eval
start. Instead, use `defvar' to mute the byte-compiler then on
the next line use `setq'. IOM!

newlist - bad name

> Il giorno 14 giugno 2021, alle ore 18:40,
> henri-biard@francemel.fr ha scritto:
>
> I want to make a new list named newlist to be
>
> (append city district)
>
> and put the new list into a new list.

There are many ways to do that. For example

(setq list-one '(1 2)) ; (1 2)
(setq list-one-two-times (list list-one list-one)) ; ((1 2) (1 2))
(setq list-one '(1 2 3)) ; (1 2 3)
list-one-two-times ; ((1 2) (1 2)) <-- still

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




reply via email to

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