# HG changeset patch # User Dave Love # Date 967040367 0 # Node ID fe7ff8fb99dc1cdd5eb2e057b504da0177514407 # Parent e9c859a12e4712e8fec5217dad71e95f9744a155 Add `last'. diff -r e9c859a12e47 -r fe7ff8fb99dc lispref/lists.texi --- a/lispref/lists.texi Wed Aug 23 12:05:12 2000 +0000 +++ b/lispref/lists.texi Wed Aug 23 14:19:27 2000 +0000 @@ -383,6 +383,14 @@ @end example @end defun +@defun last list &optional n +This function reruns the last link of the given @var{list}. The +@code{car} of this link is the list's last element. If @var{list} is +null, @code{nil} is returned. If @var{n} is non-nil the +@var{n}-th-to-last link is returned instead, or the whole @var{list} if +@var{n} is bigger than @var{list}'s length. +@end defun + @defun safe-length list This function returns the length of @var{list}, with no risk of either an error or an infinite loop.