From: Simon Strandgaard Date: 2004-05-07T01:11:44+09:00 Subject: Re: [ann] iterator-0.7 Michael Neumann wrote: > On Thu, May 06, 2004 at 07:07:09PM +0900, Simon Strandgaard wrote: > > homepage: > > http://raa.ruby-lang.org/list.rhtml?name=iterator > > > > download: > > http://rubyforge.org/frs/?group_id=18&release_id=467 > > > > > > External iterators with some STL inspiration. > > BTW, enumerator and generator both serve similar puposes and ship with > Ruby by default. [snip] > I am not sure where the differences are. And I don't say that iterator > is not useful ;-) Yes they can do somewhat the same, I just needed some iterators customized for my regexp engine. In paticular I needed to be able to reverse the direction of an iterator, so that I could do lookbehind.. for instance: irb(main):001:0> require 'iterator' => true irb(main):002:0> i = %w(a b c d e).create_iterator_end.reverse => #> irb(main):003:0> i.to_a => ["e", "d", "c", "b", "a"] irb(main):004:0> There are probably other differences. -- Simon Strandgaard