diff options
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/lispref/lists.texi | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi index 8eab2818f97..966d8f18b17 100644 --- a/doc/lispref/lists.texi +++ b/doc/lispref/lists.texi | |||
| @@ -1511,12 +1511,12 @@ respects. A property list behaves like an association list in which | |||
| 1511 | each key can occur only once. @xref{Property Lists}, for a comparison | 1511 | each key can occur only once. @xref{Property Lists}, for a comparison |
| 1512 | of property lists and association lists. | 1512 | of property lists and association lists. |
| 1513 | 1513 | ||
| 1514 | @defun assoc key alist | 1514 | @defun assoc key alist &optional testfn |
| 1515 | This function returns the first association for @var{key} in | 1515 | This function returns the first association for @var{key} in |
| 1516 | @var{alist}, comparing @var{key} against the alist elements using | 1516 | @var{alist}, comparing @var{key} against the alist elements using |
| 1517 | @code{equal} (@pxref{Equality Predicates}). It returns @code{nil} if no | 1517 | @var{testfn} if non-nil, or @code{equal} if nil (@pxref{Equality |
| 1518 | association in @var{alist} has a @sc{car} @code{equal} to @var{key}. | 1518 | Predicates}). It returns @code{nil} if no association in @var{alist} |
| 1519 | For example: | 1519 | has a @sc{car} equal to @var{key}. For example: |
| 1520 | 1520 | ||
| 1521 | @smallexample | 1521 | @smallexample |
| 1522 | (setq trees '((pine . cones) (oak . acorns) (maple . seeds))) | 1522 | (setq trees '((pine . cones) (oak . acorns) (maple . seeds))) |
| @@ -1561,11 +1561,11 @@ this as reverse @code{assoc}, finding the key for a given value. | |||
| 1561 | @defun assq key alist | 1561 | @defun assq key alist |
| 1562 | This function is like @code{assoc} in that it returns the first | 1562 | This function is like @code{assoc} in that it returns the first |
| 1563 | association for @var{key} in @var{alist}, but it makes the comparison | 1563 | association for @var{key} in @var{alist}, but it makes the comparison |
| 1564 | using @code{eq} instead of @code{equal}. @code{assq} returns @code{nil} | 1564 | using @code{eq}. @code{assq} returns @code{nil} if no association in |
| 1565 | if no association in @var{alist} has a @sc{car} @code{eq} to @var{key}. | 1565 | @var{alist} has a @sc{car} @code{eq} to @var{key}. This function is |
| 1566 | This function is used more often than @code{assoc}, since @code{eq} is | 1566 | used more often than @code{assoc}, since @code{eq} is faster than |
| 1567 | faster than @code{equal} and most alists use symbols as keys. | 1567 | @code{equal} and most alists use symbols as keys. @xref{Equality |
| 1568 | @xref{Equality Predicates}. | 1568 | Predicates}. |
| 1569 | 1569 | ||
| 1570 | @smallexample | 1570 | @smallexample |
| 1571 | (setq trees '((pine . cones) (oak . acorns) (maple . seeds))) | 1571 | (setq trees '((pine . cones) (oak . acorns) (maple . seeds))) |