From: tho_mica_l Date: 2007-12-14T18:00:19+09:00 Subject: Re: suprised by destructive map (not map!) > irb(main):002:0> array.map {|i| i << 3} > => [[1, 3], [2, 3]] Well, Array#<< means: __append__ an element to an array and return the array. It does not mean make a copy of the array plus the new element. What you expected would be one of array.map {|i| i.dup << 3} array.map {|i| i + [3]} It's not necessary to use += here since the value of "i += [3]" is i, which you really don't care about since you only want "i + [3]". Fixnum#<< means shift bits. Same symbol but totally different story. Also, numerics are no container classes but have immediate values, i.e. they are not passed by reference (according to Programming Ruby 2, p463), which is also why you can't dup/clone them.