From: Brian Candler Date: 2008-11-07T06:10:37+09:00 Subject: Re: Array.include? issue -j b- wrote: > However, when I try the > same code on OS X the > > error_out("Infinite Loop") if @history.include?([@x,@y,@heading]) > > fails to execute correctly. In other words, even if [@x,@y,@heading] > exists in @history the error_out is never executed. I have verified that > it does exist by printing the contents of the @history array before the > check. How did you print it? If it were me I'd add STDERR.puts @history.inspect STDERR.puts [@x, @y, @heading] just before the error_out line. What does this show? Could it be that error_out() really is being called, but is not behaving the way you expect? Try changing to raise "Infinite loop" if @history.include?([@x,@y,@heading]) -- Posted via http://www.ruby-forum.com/.