(append [a b] "cd" nil)
@result{} (a b 99 100)
@end group
+@end example
+
+@cindex list of characters of a string
+@cindex convert string to list of its characters
+ Here's how to convert a string into a list of its characters:
+
+@example
+@group
+(append "abcd" nil)
+ @result{} (97 98 99 100)
+@end group
@end example
With the help of @code{apply} (@pxref{Calling Functions}), we can append
Here are some examples where the final argument is not a list:
@example
+@group
(append '(x y) 'z)
@result{} (x y . z)
(append '(x y) [z])
@result{} (x y . [z])
+@end group
@end example
@noindent
resulting list. Instead, the sequence becomes the final @sc{cdr}, like
any other non-list final argument.
+ As an exception, if all the arguments but the last are @code{nil} and
+the last argument is not a list, the return value is that last argument
+unchanged:
+
+@example
+@group
+(append nil nil "abcd")
+ @result{} "abcd"
+@end group
+@end example
+
@defun copy-tree tree &optional vectors-and-records
This function returns a copy of the tree @var{tree}. If @var{tree} is a
cons cell, this makes a new cons cell with the same @sc{car} and
Each argument may be a list, vector or string.
All arguments except the last argument are copied. The last argument
-is just used as the tail of the new list.
+is just used as the tail of the new list. If the last argument is not
+a list, this results in a dotted list.
+
+As an exception, if all the arguments except the last are nil, and the
+last argument is not a list, the return value is that last argument
+unaltered.
usage: (append &rest SEQUENCES) */)
(ptrdiff_t nargs, Lisp_Object *args)