[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Wanted: Adding list-elements into an existing list
From: |
Barry Margolin |
Subject: |
Re: Wanted: Adding list-elements into an existing list |
Date: |
Thu, 16 Oct 2008 20:28:18 -0400 |
User-agent: |
MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) |
In article
<f3c2bc36-6120-4567-9297-3e91bf32e350@u46g2000hsc.googlegroups.com>,
Nordlöw <per.nordlow@gmail.com> wrote:
> (append) does not modify its first argument which is what I want.
>
> I can solve it through
> (setq x (append x y))
>
> but before I create this new function for this I just wanted to make
> sure that no such function already exists....
nconc is like append, but modifies the first argument.
But you still have to use (setq x (nconc x y)), in case x is initially
the empty list, because you can't modify the empty list in place.
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
Re: Wanted: Adding list-elements into an existing list, Pascal J. Bourguignon, 2008/10/16