From: Richard Harrington
Subject: concatenate lists
Date: 
Message-ID: <d1b16522.0108091955.c758de5@posting.google.com>
I know that the concatenate function can be performed on strings, but
is there an easy function to do this to lists - I tried using


(concatenate '(1 2 3 4) '(5 6 7 8)) 

but it didn't work - thanks for any help

From: Joseph Dale
Subject: Re: concatenate lists
Date: 
Message-ID: <3B735F88.E3481A75@uclink4.berkeley.edu>
Richard Harrington wrote:
> 
> I know that the concatenate function can be performed on strings, but
> is there an easy function to do this to lists - I tried using
> 
> (concatenate '(1 2 3 4) '(5 6 7 8))
> 
> but it didn't work - thanks for any help

[1]> (concatenate 'list '(1 2 3 4) '(5 6 7 8))
(1 2 3 4 5 6 7 8)

or

[2]> (append '(1 2 3 4) '(5 6 7 8))
(1 2 3 4 5 6 7 8)
From: Sashank Varma
Subject: Re: concatenate lists
Date: 
Message-ID: <sashank.varma-1008011342570001@129.59.212.53>
In article <·················@uclink4.berkeley.edu>, Joseph Dale
<·····@uclink4.berkeley.edu> wrote:

>Richard Harrington wrote:
>> 
>> I know that the concatenate function can be performed on strings, but
>> is there an easy function to do this to lists - I tried using
>> 
>> (concatenate '(1 2 3 4) '(5 6 7 8))
>> 
>> but it didn't work - thanks for any help
>
>[1]> (concatenate 'list '(1 2 3 4) '(5 6 7 8))
>(1 2 3 4 5 6 7 8)
>
>or
>
>[2]> (append '(1 2 3 4) '(5 6 7 8))
>(1 2 3 4 5 6 7 8)

or

[3] use NCONC if it is permissable to destructively alter the argument
    lists (and the lists are not quoted):

? (nconc (list 1 2 3 4) (list 5 6 7 8))
(1 2 3 4 5 6 7 8)
? 

i guess the last list can be a quoted without problems:

? (nconc (list 1 2 3 4) '(5 6 7 8))
(1 2 3 4 5 6 7 8)
? 

sashank