From: Aryeh Friedman Date: 2003-07-06T02:46:54+09:00 Subject: Re (repost): Is this a bug? I forgot to actually use ack vs. each below but either way I get the same behaviour... BTW I am using 1.6.8 on FreeBSD 4.8 Aryeh Friedman wrote: > Is this a bug in ruby? > > class Foo > def intialize(aVal,bVal) > @aVal=aVal > @bVal=bVal > end > > def ack > yield(@aVal,@bVal) > end > end > > foo[0]=Foo.new("ack","ack") > foo[1]=Foo.new("bar","bar") > foo[2]=Foo.new("foo","foo") > > foo.each { |aVal| puts aVal } > > Produces: > > ack > ack > bar > bar > foo > foo > > It seems the output should be: > > ack > bar > foo