Page 1 of 1

Pushing a list as multiple elements

Posted: Sat Dec 29, 2007 2:48 am
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

Posted: Sat Dec 29, 2007 8:31 am
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)
> 

Posted: Sat Dec 29, 2007 5:41 pm
by Tim Johnson
Yes indeed. Thank you.