The 'append' function takes an arbitrary number of lists and splices them together into a single list. This single list is returned. If an empty list NIL is appended, it has no effect, it does not appear in the final list. [Remember that '(nil) is not an empty list.] If a list is appended to an atom, it also has no effect and the atom will not appear in the final list.
(append) ; returns NIL (append 'a 'b) ; returns B (append '(a) '(b)) ; returns (A B) (append 'a '(b)) ; returns (B) (append '(a) 'b) ; returns (A . B) (append '(a) nil) ; returns (A) (append (list 'a 'b) (list 'c 'd)) ; returns (A B C D) (append '(a (b)) '(c (d))) ; returns (A (B) C (D)) (append '(a) nil nil nil '(b)) ; returns (A B) (append '(a) '(nil) '(b)) ; returns (A NIL B)
Note: If a list is appended to an atom, XLISP raises no error, the atom just disappears!
See the