From: "Brian Schröder" Date: 2005-03-10T23:28:24+09:00 Subject: Re: Is iterating in lock-step possible? On Thu, 10 Mar 2005 22:06:10 +0900, ts wrote: > >>>>> "B" == =?ISO-8859-1?Q?Brian Schr=F6der?= writes: > > B> Or in simple cases where the additional memory overhead is not > B> important, you can also use the zip funtion. I.e. > > B> %w(eins zwei drei).zip([1,2,3]).each do | name, value | > B> puts "The value of #{name} is #{value}" > B> end > > Why do you use #each ? > > svg% ruby -e '%w(eins zwei drei).zip([1,2,3]) {|a, b| puts "#{a} #{b}" }' > eins 1 > zwei 2 > drei 3 > svg% > > no memory overhead > > Guy Decoux > > Thank you, I thought that was something not yet in the standard lib. Wasn't there a discussion about this on this list not so long ago? Anyway, learned something more. regards, Brian -- Brian Schr�der http://ruby.brian-schroeder.de/