help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

append - bug or feature?


From: TheFlyingDutchman
Subject: append - bug or feature?
Date: Wed, 08 Dec 2010 15:21:09 -0000
User-agent: G2/1.0

The documentation for append says:
_____________________________________________________
This function returns a list containing all the elements of sequences.
The sequences may be lists, vectors, bool-vectors, or strings, but the
last one should usually be a list. All arguments except the last one
are copied, so none of the arguments is altered.

More generally, the final argument to append may be any Lisp object.
The final argument is not copied or converted; it becomes the CDR of
the last cons cell in the new list. If the final argument is itself a
list, then its elements become in effect elements of the result list.
If the final element is not a list, the result is a "dotted list"
since its final CDR is not nil as required in a true list.
______________________________________________________

A "dotted list" will blow up functions like length and  append (if it
is not the last argument). Are there situations in which a "dotted
list" is more useful than a list - times when you would want to create
one?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]