From: "Hal E. Fulton" Date: 2003-03-29T07:30:33+09:00 Subject: Re: Need #collect! on partial array ----- Original Message ----- From: "Gennady" To: "ruby-talk ML" Sent: Friday, March 28, 2003 4:23 PM Subject: Re: Need #collect! on partial array > It is cheating, in a way ;-). `i' holds a reference to the original element > and your 'upcase!' modifies it in place. You can replace 'collect!' with > 'each' and the result will be the same, in other words 'collect!' does not > work here at all (to be precise, it modifies an array that will be marked > for GC immediately). As far as I understand it is not what the original post > meant. Right... for example, if instead of uppercasing some strings you were incrementing some integers, this wouldn't work. Hal