[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Wanted: Adding list-elements into an existing list
From: |
Nordlöw |
Subject: |
Re: Wanted: Adding list-elements into an existing list |
Date: |
Thu, 16 Oct 2008 06:36:30 -0700 (PDT) |
User-agent: |
G2/1.0 |
On 16 Okt, 15:16, Joost Diepenmaat <jo...@zeekat.nl> wrote:
> Nordlöw <per.nord...@gmail.com> writes:
> > Is there a variant of the function add-to-list(a b) where b can be a
> > list aswell?
>
> > (add-list-elements-to-list '(a b c) '(c d e)) should evaluate '(a b c
> > d e)
>
> > or do I have to implement it myself using an iteration-construct?
>
> That's what (append) does:
>
> append is a built-in function in `C source code'.
>
> (append &rest SEQUENCES)
>
> Concatenate all the arguments and make the result a list. The result
> is a list whose elements are the elements of all the arguments. Each
> argument may be a list, vector or string. The last argument is not
> copied, just used as the tail of the new list.
>
> --
> Joost Diepenmaat | blog:http://joost.zeekat.nl/| work:http://zeekat.nl/
(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....
/Nordlöw
Re: Wanted: Adding list-elements into an existing list, Pascal J. Bourguignon, 2008/10/16