George Ogata
3/10/2005 5:37:00 PM
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.