summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2023-04-27 13:52:57 +0200
committerMattias EngdegÄrd <mattiase@acm.org>2023-04-27 14:20:45 +0200
commit5ead8c5f69b0a69bac4641d5003ee422d6b67038 (patch)
tree93d3b62d029b3d51ac09c00adb5e66a17d49a95f /doc
parent1dcb737405a7a299fe6d01a5d9bd0c79328920b7 (diff)
downloademacs-5ead8c5f69b0a69bac4641d5003ee422d6b67038.tar.gz
Clarify `nconc` behaviour for dotted lists (bug#63103)
* doc/lispref/lists.texi (Rearrangement): Explicitly say that dotted lists are valid args to `nconc` and give an example.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/lists.texi10
1 files changed, 9 insertions, 1 deletions
diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi
index a509325854f..22a5f7f1239 100644
--- a/doc/lispref/lists.texi
+++ b/doc/lispref/lists.texi
@@ -1224,7 +1224,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