raja / cs.indiana.edu (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?

It ain't pretty, but

   http://www.rubycentral.com/faq/rubyfaq-5.html#ss5.5

> but was wondering if there was something along the lines of Common Lisp's
> 'loop'  where x & y move in tandem:
> 
>             (loop for x in '(1 3  5  7  9)
>                   for y in '(1 9 25 49 81)
>                   do (format t "~& ~d ~d" x y))

What does this do if x and y were iterating over different length
arrays?


Dave