Dan Doel wrote:

> No, his point is that you can't zip two such objects together. You need at
> least one explicit iterator.

Ah!  I thought he was just commenting on the fact that Dave's Fib#each was storing all the values.  I thought Gabriele just thought this was necessary to make it work.

> Or some similar pattern. However, Fib needs to provide a #next for this
> to work.

Yep, I see what you mean.

> It's possible to make things that will zip lazily in Ruby, it's just not
> possible with or as convenient as the implicit iterators that are common,
> and it's not as convenient as some other languages make it (Haskell, for
> example).

I've never used Enumerable#zip, hence it doesn't feel like a big problem :-), but I wonder whether, if we had an easy way to build a "next", it would be used all over the place?

H.