1 |
@c -*-texinfo-*- |
@c -*-texinfo-*- |
2 |
@c This is part of the GNU Emacs Lisp Reference Manual. |
@c This is part of the GNU Emacs Lisp Reference Manual. |
3 |
@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999 |
@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, |
4 |
|
@c 2003, 2004 |
5 |
@c Free Software Foundation, Inc. |
@c Free Software Foundation, Inc. |
6 |
@c See the file elisp.texi for copying conditions. |
@c See the file elisp.texi for copying conditions. |
7 |
@setfilename ../info/lists |
@setfilename ../info/lists |
349 |
@end example |
@end example |
350 |
@end defmac |
@end defmac |
351 |
|
|
|
@anchor{Definition of nth} |
|
352 |
@defun nth n list |
@defun nth n list |
353 |
|
@anchor{Definition of nth} |
354 |
This function returns the @var{n}th element of @var{list}. Elements |
This function returns the @var{n}th element of @var{list}. Elements |
355 |
are numbered starting with zero, so the @sc{car} of @var{list} is |
are numbered starting with zero, so the @sc{car} of @var{list} is |
356 |
element number zero. If the length of @var{list} is @var{n} or less, |
element number zero. If the length of @var{list} is @var{n} or less, |
414 |
if @var{n} is bigger than @var{list}'s length. |
if @var{n} is bigger than @var{list}'s length. |
415 |
@end defun |
@end defun |
416 |
|
|
|
@anchor{Definition of safe-length} |
|
417 |
@defun safe-length list |
@defun safe-length list |
418 |
|
@anchor{Definition of safe-length} |
419 |
This function returns the length of @var{list}, with no risk of either |
This function returns the length of @var{list}, with no risk of either |
420 |
an error or an infinite loop. It generally returns the number of |
an error or an infinite loop. It generally returns the number of |
421 |
distinct cons cells in the list. However, for circular lists, |
distinct cons cells in the list. However, for circular lists, |