1670 |
@defun assq-delete-all key alist |
@defun assq-delete-all key alist |
1671 |
@tindex assq-delete-all |
@tindex assq-delete-all |
1672 |
This function deletes from @var{alist} all the elements whose @sc{car} |
This function deletes from @var{alist} all the elements whose @sc{car} |
1673 |
is @code{eq} to @var{key}. It returns @var{alist}, modified |
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 |
such each element one by one. It returns the shortened alist, and |
1675 |
of @var{alist}. |
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}. |
1678 |
|
|
1679 |
@example |
@example |
1680 |
(assq-delete-all 'foo |
(setq alist '((foo 1) (bar 2) (foo 3) (lose 4))) |
1681 |
'((foo 1) (bar 2) (foo 3) (lose 4))) |
@result{} ((foo 1) (bar 2) (foo 3) (lose 4)) |
1682 |
|
(assq-delete-all 'foo alist) |
1683 |
@result{} ((bar 2) (lose 4)) |
@result{} ((bar 2) (lose 4)) |
1684 |
|
alist |
1685 |
|
@result{} ((foo 1) (bar 2) (lose 4)) |
1686 |
@end example |
@end example |
1687 |
@end defun |
@end defun |
1688 |
|
|