Is iterating in lock-step possible?

William Morgan <wmorgan-ruby-talk@masanjin.net> writes:

In my post, I chose the array.each only as an example. Its not arrays
for which I want to do this with - I want to solve the problem for
iterator calls. If zip() internally creates a list of values from both
iterations, then it does not help me. I want to be able to do the actual
computation of the iterator calls in lock-step.

Enum#zip internally turns everything into arrays.

Actually, only the arguments are converted; the receiving object is
iterated over using #each (or for Array, a standard C array
iteration). So, if only one list must not be converted to an array,
just call #zip on that list.

Excerpts from George Ogata's mail of 10 Mar 2005 (EST):

Actually, only the arguments are converted; the receiving object is
iterated over using #each (or for Array, a standard C array
iteration). So, if only one list must not be converted to an array,
just call #zip on that list.

Oh, you're right. Thanks.

I think it still doesn't solve the original poster's problem, though.

ยทยทยท

--
William <wmorgan-ruby-talk@masanjin.net>