From: Mark Hahn Date: 2001-12-31T01:57:53+09:00 Subject: [ruby-talk:29730] Re: Ruby and variables (was Re: Perl/Python Module Porting) > Do you really want to change the value of the integer object 1 into 2? When you do s = "a" s.succ! it does not change all strings "a" into string "b", so why should i=1 i.succ! change all integers 1 into integer 2? I think that the real answer is that Numeric objects are immutable and String objects are mutable. A mutable integer class such as: class Int attr :value end could do i.succ!. I think Benoit is asking for your Fixnum to behave like this Int class. I personally think the performance advantages of your method of storing Fixnum values is great enough to justify keeping Numeric immutable. Unfortunately, this means everyone learning ruby must remember what is mutable and what is not. ----- Original Message ----- From: "Yukihiro Matsumoto" To: "ruby-talk ML" Sent: Sunday, December 30, 2001 6:54 AM Subject: [ruby-talk:29724] Re: Ruby and variables (was Re: Perl/Python Module Porting) > Hi, > > In message "[ruby-talk:29720] Re: Ruby and variables (was Re: Perl/Python Module Porting)" > on 01/12/30, "Benoit Cerrina" writes: > > |> ..while you can't do: > |> > |> angle.to_rad! (or angle.deg2rad!) > |or int.succ! > > Do you really want to change the value of the integer object 1 into 2? > > matz. >