From: William Djaja Tjokroaminata Date: 2002-11-26T13:05:19+09:00 Subject: Re: Things That Newcomers to Ruby Should Know (11/24/02) Daniel Carrera wrote: > I don't follow that. Why is it that I can do string.chomp! but it is not > conceivable to do x.succ!? Aren't you changing self with string.chomp!? Hi Daniel, Gavin has given you some answers and concepts based on Ruby itself. Another answer can be found by looking at how Ruby objects are implemented in C. If you read the "Extending Ruby" chaper in the pickaxe book, Ruby variables all have the (C) type of 'VALUE', which is either a pointer to a Ruby object or an immediate value (such as Fixnum). In principle, you cannot have a "self-changing" method for objects which have immediate values (such as Fixnum, Symbol, true, false, and nil). (Well, reading my own post, I conclude that in principle, we can actually have x.succ! if x is a Bignum; oh, boy... But it is never going to be implemented, as the conversion between Fixnum and Bignum is automatic.) Regards, Bill