Pushing a list as multiple elements

Notices and updates
Locked
Tim Johnson
Posts: 253
Joined: Thu Oct 07, 2004 7:21 pm
Location: Palmer Alaska USA

Pushing a list as multiple elements

Post by Tim Johnson »

consider the following;

Code: Select all

> (set 't '(4 5 6))
(4 5 6)
> (set 'test '(1 2 3))
(1 2 3)
> (push t test -1)
> test
(1 2 3 (4 5 6))
;; Is there an existing function implementation that will give me:

Code: Select all

(1 2 3 4 5 6)
Yes, flat will give me those result, but I may not want to
'flatten other elements in the target list.
Thanks
Tim

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Post by cormullion »

Perhaps append is the one:

Code: Select all

> t
(4 5 6)
> test
(1 2 3)
> (append test t)
(1 2 3 4 5 6)
> 

Tim Johnson
Posts: 253
Joined: Thu Oct 07, 2004 7:21 pm
Location: Palmer Alaska USA

Post by Tim Johnson »

Yes indeed. Thank you.

Locked