OOPS either leave ack off or do foo.ack {....} instead of foo.each ...
either produdes the same behavor... btw I have 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