So,

Would it be correct to say that an iterator is a method that lets you 
access items one at a time? (this includes both class and instance 
methods).

So I cansay that Array#each is an iterator.

Would this be correct?

Thanks.

BTW, what is FOLDOC?


On Thu, Jan 23, 2003 at 07:10:28AM +0900, Bruce Williams wrote:
> On Wednesday 22 January 2003 05:07 pm, Daniel Carrera wrote:
> | I sort of know what an iterator is, but not well enough to explain it.
> |
> | What would be a one-sentence definition of an iterator?
> 
> From FOLDOC:
> 
>  <programming> An object or routine for accessing items
>    from a list, array or stream one at a time.
> 
> -- 
> Bruce R. Williams :: [iusris/#ruby-lang] :: http://www.codedbliss.com
> 
>   'It does not require a majority to prevail, but rather an irate,
>   tireless minority keen to set brush fires in people's minds.'
>   -- Samuel Adams
> 

-- 
Daniel Carrera
Graduate Teaching Assistant.  Math Dept.
University of Maryland.  (301) 405-5137