From: Robert Klemme Date: 2008-04-04T21:19:27+09:00 Subject: Re: Array disorder in ruby 1.8.6 2008/4/4, Frantisek Havluj : > I suppose I found a bug in ruby (or behavior that I am unable to > explain). My version is, exactly, ruby 1.8.6 (2007-03-13 patchlevel 0) > [universal-darwin8.0] > > problem is in this method: > > def plotresults(results,runset) > ... > runset.each{|k| f.printf("%-*s",ns,k)} > ... > end > > .each iterator just prints the items of the runset array out of order. What exactly do you mean by "out of order"? What order? What type is runset? > however, if I just evaluate the array anywhere in the method, everything > is ok: What do you mean be "evaluate"? > def plotresults(results,runset) > runset > ... > runset.each{|k| f.printf("%-*s",ns,k)} > ... > end > > Not much more to say about that. Can anybody explain to me why Ruby > should behave like that? You need to say more about that - otherwise we can't say much more about it. Cheers robert -- use.inject do |as, often| as.you_can - without end