From: Hal Fulton Date: 2003-08-29T01:36:17+09:00 Subject: Re: #collect with block modifying receiver mark wrote: > Running the code from The Ruby Way I get > > [mark@laptop mark]$ ruby1.6 -v test.rb > ruby 1.6.7 (2002-03-01) [i586-linux-gnu] > [1, 4, 3, 5, 2] > [4, 5, 2, 3, 1] > [mark@laptop mark]$ ruby -v test.rb > ruby 1.8.0 (2003-08-04) [i686-linux] > test.rb:5: warning: parenthesize argument(s) for future version > test.rb:10: warning: parenthesize argument(s) for future version > [2, 5, 1] > [2, 3, 4] > > So it does look like there has been a change between 1.6.7 and 1.8.0 OK, so this *really* makes me wonder what the "theoretically correct" behavior is. My first thought is that this: receiver.collect { some_operation_altering_receiver } should behave the same as this: receiver.dup.collect { some_operation_altering_receiver } Matz, are you listening?? Enlighten us, please... Hal