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

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

Re: `append' vs. `nconc'


From: Teemu Likonen
Subject: Re: `append' vs. `nconc'
Date: Thu, 31 Dec 2015 09:31:57 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5.50 (gnu/linux)

Emanuel Berg [2015-12-31 04:50:19+01] wrote:

> Teemu Likonen <tlikonen@iki.fi> writes:
>> Don't modify a list created with '(...). Use (list ...) instead.
>
> What about the elements of the lists? If they are themselves lists,
> can they be created with ' or is this rule a "recursive descent" one?

NCONC doesn't touch the elements (i.e., CAR values of conses) so this is
fine:

    (setq foo (nconc (list '(a . 1) '(b . 2)) foo))

-- 
/// Teemu Likonen   - .-..   <https://github.com/tlikonen> //
// PGP: 4E10 55DC 84E9 DFF6 13D7 8557 719D 69D3 2453 9450 ///

Attachment: signature.asc
Description: PGP signature


reply via email to

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