diff options
Diffstat (limited to 'doc/lispref/lists.texi')
-rw-r--r-- | doc/lispref/lists.texi | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi index 6ad6c487d0b..1409e51c0d4 100644 --- a/doc/lispref/lists.texi +++ b/doc/lispref/lists.texi @@ -696,16 +696,17 @@ not a list, the sequence's elements do not become elements of the resulting list. Instead, the sequence becomes the final @sc{cdr}, like any other non-list final argument. -@defun copy-tree tree &optional vecp +@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 @sc{cdr}, then recursively copies the @sc{car} and @sc{cdr} in the same way. Normally, when @var{tree} is anything other than a cons cell, -@code{copy-tree} simply returns @var{tree}. However, if @var{vecp} is -non-@code{nil}, it copies vectors too (and operates recursively on -their elements). +@code{copy-tree} simply returns @var{tree}. However, if +@var{vectors-and-records} is non-@code{nil}, it copies vectors and records +too (and operates recursively on their elements). The @var{tree} +argument must not contain cycles. @end defun @defun flatten-tree tree @@ -1224,7 +1225,15 @@ x @end example However, the other arguments (all but the last) should be mutable -lists. +lists. They can be dotted lists, whose last @sc{cdr}s are then +replaced with the next argument: + +@example +@group +(nconc (cons 1 2) (cons 3 (cons 4 5)) 'z) + @result{} (1 3 4 . z) +@end group +@end example A common pitfall is to use a constant list as a non-last argument to @code{nconc}. If you do this, the resulting behavior is undefined |