chickadee » srfi-121 » gdelete-neighbor-dups

gdelete-neighbor-dups gen #!optional =procedure

Creates a generator that returns whatever gen returns, except for any items that are equal to the preceding item in the sense of =, which defaults to equal?. The = predicate is passed exactly two arguments, of which the first was generated by gen before the second.

(generator->list (gdelete-neighbor-dups (list->generator '(a a b c a a a d c))))
  ⇒ (a b c a d c)