From: Yusuke ENDOH Date: 2009-07-11T01:48:29+09:00 Subject: [ruby-core:24255] Re: [Bug #1747] Immediate Values Can be Frozen 2009/7/10 Gary Wright : > > On Jul 9, 2009, at 12:15 AM, Yusuke ENDOH wrote: >> >> It seems to be an intentional change for the following use case: >> >> �# http://nov.tdiary.net/20071215.html#p02 (In Japanese) >> �CONST2 = ["hoge", 1].freeze >> �CONST2.each(&:freeze).all?(&:frozen?) #=> false (expected true) >> >> I have no idea whether the the rationale is sensible or not. >> If the compatibility can be ignored, it would be more reasonable that >> all immediate values are frozen as a default. > > Making Fixnum instances frozen by default would break code that depended on > instance variable state: > > class Fixnum > �attr_accessor :note > end > > 42.note = 'the meaning of life' I see. Then, the current behavior of 1.9 seems to me to be reasonable. -- Yusuke ENDOH