From: Ricardo Panaggio Date: 2010-07-22T10:43:20+09:00 Subject: Re: Enumerators and generators Hello Hal Generators "externalize" iteration, whereas Enumerator "internalize" it (but this docs may have already told you). Generators can be used to create a "controlled stream" of objects, that you can operate as you where using a remove control: go to the next (Generator#next), give me the position (Generator#pos), return to the beginning (Generator#rewind), ... Enumerator offers methods to iterate through the entire stream, like iterate using a windows of size X (Enumerator#each_cons), iterate using slices from the stream (Enumerator#each_slide), ... They are quite different in use, although both are usable to iterate over data. On Wed, Jul 21, 2010 at 22:12, Hal Fulton wrote: > Hi, all... > > I'm trying to grasp when/why one might use a generator instead of > an enumerator (or vice versa). > > I've used generators, but enumerators are newer to me. > > I've heard one person's take on this (thanks David!) but thought > I might ask more thoughts... > > Thanks, > Hal Fulton >