From: Sebastian Hungerecker Date: 2008-05-04T02:56:43+09:00 Subject: Re: Why there is not "replace" method for Fixnum? IƱaki Baz Castillo wrote: > But Fixnum has not this method "replace", neither Float. Consider this: a = 5 b = 5 a.object_id == b.object_id #=> true So a and b point to the same object even if there was no "a = b" anywhere. That is because in ruby there is only one single instance of any integer, so two variables pointing to 5 always point to the same object. This is because of performance. As a consequence of this something like 5.replace 6 would change *all* occurences of 5 to 6 which clearly would not be the desired behaviour. So there is no Integer#replace. HTH, Sebastian -- NP: Depeche Mode - Shake The Disease Jabber: sepp2k@jabber.org ICQ: 205544826