diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-08-19 16:48:59 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-08-19 16:48:59 -0700 |
commit | 07fcbb558d797272b9f43547da60beda485873a3 (patch) | |
tree | 77d5da14e9f9d9d8b1d877c70c01296fd3893796 /doc/lispref/lists.texi | |
parent | c9bdeff3e45a7ac84a74a81bb048046f82dddc91 (diff) | |
parent | fb81c8c3adf8633f2f617c82f6019aef630860c7 (diff) | |
download | emacs-07fcbb558d797272b9f43547da60beda485873a3.tar.gz |
Merge remote-tracking branch 'origin/master' into athena/unstable
Diffstat (limited to 'doc/lispref/lists.texi')
-rw-r--r-- | doc/lispref/lists.texi | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi index 2805b1f5fdc..bbe1dce42d8 100644 --- a/doc/lispref/lists.texi +++ b/doc/lispref/lists.texi @@ -1557,10 +1557,12 @@ of property lists and association lists. @defun assoc key alist &optional testfn This function returns the first association for @var{key} in @var{alist}, comparing @var{key} against the alist elements using -@var{testfn} if it is non-@code{nil} and @code{equal} otherwise -(@pxref{Equality Predicates}). It returns @code{nil} if no -association in @var{alist} has a @sc{car} equal to @var{key}. For -example: +@var{testfn} if it is a function, and @code{equal} otherwise +(@pxref{Equality Predicates}). If @var{testfn} is a function, it is +called with two arguments: the @sc{car} of an element from @var{alist} +and @var{key}. The function returns @code{nil} if no +association in @var{alist} has a @sc{car} equal to @var{key}, as +tested by @var{testfn}. For example: @smallexample (setq trees '((pine . cones) (oak . acorns) (maple . seeds))) @@ -1804,7 +1806,7 @@ through a simple example: (let-alist colors (if (eq .rose 'red) .lily)) -=> white + @result{} white @end lisp The @var{body} is inspected at compilation time, and only the symbols @@ -1820,7 +1822,7 @@ Nested association lists is supported: (let-alist colors (if (eq .rose 'red) .lily.belladonna)) -=> yellow + @result{} yellow @end lisp Nesting @code{let-alist} inside each other is allowed, but the code in |