From: Robert Klemme Date: 2013-02-18T02:23:56+09:00 Subject: Re: How the string concatenation operator hackes(modifies) the string contents of frozen array? On Sat, Feb 16, 2013 at 9:46 PM, Love U Ruby wrote: > That's why array#replace allowed on the frozen array, but none of the It isn't irb(main):001:0> a=10.times.to_a.freeze => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] irb(main):002:0> a.replace [10,20] RuntimeError: can't modify frozen Array from (irb):2:in `replace' from (irb):2 from /usr/bin/irb:12:in `
' > array#pop,array#push,array#rotate! etc not allowed. Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/