newLISP Fan Club

Forum => newLISP newS => Topic started by: Tim Johnson on December 28, 2007, 06:48:18 PM

Title: Pushing a list as multiple elements
Post by: Tim Johnson on December 28, 2007, 06:48:18 PM
consider the following;
> (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:
(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
Title:
Post by: cormullion on December 29, 2007, 12:31:19 AM
Perhaps append is the one:


> t
(4 5 6)
> test
(1 2 3)
> (append test t)
(1 2 3 4 5 6)
>
Title:
Post by: Tim Johnson on December 29, 2007, 09:41:07 AM
Yes indeed. Thank you.