From: Alex Young Date: 2007-12-13T22:08:26+09:00 Subject: Re: suprised by destructive map (not map!) Bernardo Monteiro Rufino wrote: > Use it: > irb(main):001:0> array = [[1], [2]] > => [[1], [2]] > irb(main):002:0> array.map{|a| a += [3]} That expands to: array.map{|a| a = a + [3] } The Array#+ method isn't destructive, and a variable assignment in a block isn't either. -- Alex