Give syntax for using the 'for' shortcut on multiple arrays.
Iteration over multiple enumerables at once is not simple or intuitive, involving explicit indexing into each of the enums (fine for people who came from C), and what is being iterated over is not well described by the loop control of the iteration (for example: '[a.length, b.length].max.times do |i| puts a[i],b[i] end').
Allow comma delimited list of Enumerables to be zipped together and iterated over.
for x,y,z in enum_1,enum_2,enum_3 puts x,y,z endwould be a shortcut to
enum_1.zip(enum_2, enum_3).each do |x,y,z| puts x,y,z end
The shortcut wouldn't carry over and be able to help the normal use of #each, as 'for' is already doing some magic, and it would have to be doing more with this.
To be able to mix Hashes, Arrays, &c., further magic would have to happen, such as calling #to_a on all enums passed as arguments to #zip (possibly moving that behavior to #zip itself).
Back to RCRchive.
RCR Submission page and RCRchive powered by Ruby, Apache, RuWiki (modified), and RubLog