emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Adding rassq-delete-all to lisp/subr.el.


From: Lute Kamstra
Subject: Adding rassq-delete-all to lisp/subr.el.
Date: Tue, 19 Apr 2005 15:28:53 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

lisp/subr.el currently defines assq-delete-all.  What about providing
rassq-delete-all as well?

Lute.


(defun rassq-delete-all (value alist)
  "Delete from ALIST all elements whose cdr is `eq' to VALUE.
Return the modified alist.
Elements of ALIST that are not conses are ignored."
  (let ((tail alist))
    (while tail
      (when (and (consp (car tail)) (eq (cadr tail) value))
        (setq alist (delq (car tail) alist)))
      (setq tail (cdr tail)))
    alist))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]