# HG changeset patch # User Stefan Monnier # Date 974042044 0 # Node ID ca84a4992948eace72afcae4490c26a0117bd95d # Parent bc45f260e6318c65439fbefa4e417e418c7bb8d5 (Building Lists): Add footnote to explain how to add to the end of a list. diff -r bc45f260e631 -r ca84a4992948 lispref/lists.texi --- a/lispref/lists.texi Sun Nov 12 13:26:15 2000 +0000 +++ b/lispref/lists.texi Sun Nov 12 15:14:04 2000 +0000 @@ -457,8 +457,16 @@ @cindex consing @code{cons} is often used to add a single element to the front of a -list. This is called @dfn{consing the element onto the list}. For -example: +list. This is called @dfn{consing the element onto the list}. +@footnote{There is no strictly equivalent way to add an element to +the end of a list. You can use @code{(append @var{listname} (list +@var{newelt}))}, which creates a whole new list by copying @var{listname} +and adding @var{newelt} to its end. Or you can use @code{(nconc +@var{listname} (list @var{newelt}))}, which modifies @var{listname} +by following all the @sc{cdr}s and then replacing the terminating +@code{nil}. Compare this to adding an element to the beginning of a +list with @code{cons}, which neither copies nor modifies the list.} +For example: @example (setq list (cons newelt list))