From: matz@... (Yukihiro Matsumoto) Date: 2000-12-09T23:48:01+09:00 Subject: [ruby-talk:6968] Re: parallel array traversal Hi, In message "[ruby-talk:6956] parallel array traversal" on 00/12/09, Raja S. writes: |Is there a way to do a parallel traversal of a group of arrays in Ruby? |Or more generally move a collection of index variables in lock-step? Hmm. |Python has come recently added the 'zip' facility. Reasonable, but it also |creates unnecessary garbage by creating an object that in most situations gets |discarded once one is out of the loop. IIRC, Python's zip creates [[a1, b1, c1], [a2, b2, c2],...] from [a1,a2,...], [b1, b2,...] and [c1, c2,...]. How about something like [a1, a2, a3].zip do |x, y, z| ... end which do not create unnecessary objects? There might be better name for this method. matz.