From: "Hal E. Fulton" Date: 2003-03-25T16:26:15+09:00 Subject: Re: Iterate over two lists in parallel ----- Original Message ----- From: "Hal E. Fulton" To: "ruby-talk ML" Sent: Tuesday, March 25, 2003 1:22 AM Subject: Re: Iterate over two lists in parallel > I'd really rather use the object itself to > iterate, even if I must initialize it. > > Something like: > > x = [5,6,7,8,9] > x.reset > loop do > a = x.get > # ... > end > > C'est possible? Sprry to reply to my own post, but another small issue is that the generator always returns nil after it exhausts the collection. But what if a collection contains nil values? I think I'd like an 'end?' method or something. At worst, we could define a meta-nil value, but I'm betting that's not necessary. Hal