[Top][All Lists]

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

Re: Delayed warnings

From: Juanma Barranquero
Subject: Re: Delayed warnings
Date: Thu, 28 Apr 2011 00:11:41 +0200

On Wed, Apr 27, 2011 at 19:32, Stefan Monnier <address@hidden> wrote:

> You might want to add some code to avoid/detect repetitions.

(delete-dups '(A A B A B B C B C C D)) => A B C D


(uniqify '(A A B A B B C B C C D)) => A B A B C B C D



P.S.: Assuming

(defun uniqify (list)
  "Destructively remove consecutive `equal' duplicates from LIST.
Store the result in LIST and return it.  LIST must be a proper list."
  (let ((l list))
    (while (cdr l)
      (if (equal (car l) (cadr l))
          (setcdr l (cddr l))
        (setq l (cdr l))))

which should be in subr.el, because its functionality is duplicated in
quite a few .el files.

reply via email to

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