diff options
| author | Richard M. Stallman | 2003-09-30 13:00:23 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2003-09-30 13:00:23 +0000 |
| commit | 66fd2c72334d7db3dfa38c3c7b875ecefa6cdd0f (patch) | |
| tree | 33d81af32b85a74989ae58c619bc4e40ba0c3ae9 | |
| parent | 4d6e212f9cff38935e3e8e5db889553574c12e55 (diff) | |
| download | emacs-66fd2c72334d7db3dfa38c3c7b875ecefa6cdd0f.tar.gz emacs-66fd2c72334d7db3dfa38c3c7b875ecefa6cdd0f.zip | |
(Association Lists): Clarify `assq-delete-all'.
| -rw-r--r-- | lispref/lists.texi | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lispref/lists.texi b/lispref/lists.texi index b437916694f..5042d52d674 100644 --- a/lispref/lists.texi +++ b/lispref/lists.texi | |||
| @@ -1670,14 +1670,19 @@ the associations of one copy without affecting the other: | |||
| 1670 | @defun assq-delete-all key alist | 1670 | @defun assq-delete-all key alist |
| 1671 | @tindex assq-delete-all | 1671 | @tindex assq-delete-all |
| 1672 | This function deletes from @var{alist} all the elements whose @sc{car} | 1672 | This function deletes from @var{alist} all the elements whose @sc{car} |
| 1673 | is @code{eq} to @var{key}. It returns @var{alist}, modified | 1673 | is @code{eq} to @var{key}, much as if you used @code{delq} to delete |
| 1674 | in this way. Note that it modifies the original list structure | 1674 | such each element one by one. It returns the shortened alist, and |
| 1675 | of @var{alist}. | 1675 | often modifies the original list structure of @var{alist}. For |
| 1676 | correct results, use the return value of @code{assq-delete-all} rather | ||
| 1677 | than looking at the saved value of @var{alist}. | ||
| 1676 | 1678 | ||
| 1677 | @example | 1679 | @example |
| 1678 | (assq-delete-all 'foo | 1680 | (setq alist '((foo 1) (bar 2) (foo 3) (lose 4))) |
| 1679 | '((foo 1) (bar 2) (foo 3) (lose 4))) | 1681 | @result{} ((foo 1) (bar 2) (foo 3) (lose 4)) |
| 1682 | (assq-delete-all 'foo alist) | ||
| 1680 | @result{} ((bar 2) (lose 4)) | 1683 | @result{} ((bar 2) (lose 4)) |
| 1684 | alist | ||
| 1685 | @result{} ((foo 1) (bar 2) (lose 4)) | ||
| 1681 | @end example | 1686 | @end example |
| 1682 | @end defun | 1687 | @end defun |
| 1683 | 1688 | ||