diff options
| author | Dave Love | 2000-08-23 14:19:27 +0000 |
|---|---|---|
| committer | Dave Love | 2000-08-23 14:19:27 +0000 |
| commit | dbda27d1f9ba40181f52d2e93218b54181d93c5a (patch) | |
| tree | b1d1db51dc236a2ee383fd89ef0b45018ce8c437 | |
| parent | bfccb7b3bc8579f8221c126e9482ad418ce38677 (diff) | |
| download | emacs-dbda27d1f9ba40181f52d2e93218b54181d93c5a.tar.gz emacs-dbda27d1f9ba40181f52d2e93218b54181d93c5a.zip | |
Add `last'.
| -rw-r--r-- | lispref/lists.texi | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lispref/lists.texi b/lispref/lists.texi index 64e634d2803..458d011c489 100644 --- a/lispref/lists.texi +++ b/lispref/lists.texi | |||
| @@ -383,6 +383,14 @@ If @var{n} is zero or negative, @code{nthcdr} returns all of | |||
| 383 | @end example | 383 | @end example |
| 384 | @end defun | 384 | @end defun |
| 385 | 385 | ||
| 386 | @defun last list &optional n | ||
| 387 | This function reruns the last link of the given @var{list}. The | ||
| 388 | @code{car} of this link is the list's last element. If @var{list} is | ||
| 389 | null, @code{nil} is returned. If @var{n} is non-nil the | ||
| 390 | @var{n}-th-to-last link is returned instead, or the whole @var{list} if | ||
| 391 | @var{n} is bigger than @var{list}'s length. | ||
| 392 | @end defun | ||
| 393 | |||
| 386 | @defun safe-length list | 394 | @defun safe-length list |
| 387 | This function returns the length of @var{list}, with no risk | 395 | This function returns the length of @var{list}, with no risk |
| 388 | of either an error or an infinite loop. | 396 | of either an error or an infinite loop. |