From: Jano Svitok Date: 2008-04-04T21:03:25+09:00 Subject: Re: Array disorder in ruby 1.8.6 On Fri, Apr 4, 2008 at 1:57 PM, Frantisek Havluj wrote: > Hello, > > 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. > however, if I just evaluate the array anywhere in the method, everything > is ok: > > 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? One question: is runset really an Array or a Set? Set doesn't keep the order. Jano