No, that's not it: you do call (append list2 (list ...))
, with the 2nd arg enclosed in a list
.
The problem is that you use append
while you ought to use simple cons
there: (thing (cdr list1) (cons (car list1) list2))
.
With cons
, each new element from list1
will go on top (i.e. "to the left of") the previously handled ones, hence building the result in reverse:
(a b c d e)
--------------------------
(a b c d e) ()
(b c d e) (a)
(c d e) (b a)
(d e) (c b a)
(e) (d c b a)
() (e d c b a)
--------------------------
(e d c b a)
But with append
you're just recreating the same list.