From: "Kroeger, Simon (ext)" Date: 2005-12-08T19:47:05+09:00 Subject: Re: increasing counter whithin loop? > > able to use it. I'd probably have to create each_with_prev_and_next. It's allready there: ----------------------------------------------------------------- require 'enumerator' a=[:a, :b, :b, :c, :b, :d, :e, :e] ([nil] + a + [nil]).each_cons(3) do |prv, this, nxt| next if prv == this print 'double_' if this == nxt puts this end ----------------------------------------------------------------- output: a double_b c b d double_e cheers Simon