From: Gavin Sinclair Date: 2002-11-26T18:31:05+09:00 Subject: Re: Things That Newcomers to Ruby Should Know (11/24/02) From: "Simon Cozens" > "Gavin Sinclair" writes: > > irb(main):001:0> s = "String\n" > > "String\n" > > irb(main):002:0> s.id > > 134560740 > > irb(main):003:0> s.chomp! > > "String" > > irb(main):004:0> s.id > > 134560740 > .... > > Confusing implementation limitations and language design was Perl 5's big > problem. Don't let it become Ruby's big problem too. The above code merely demonstrates that String#chomp! doesn't modify 'self', rather it modifies the data of the object. The only "implementation limitations" discussed here are that integers are immediate values. No problems arise from this - except that ++ doesn't behave as in C/Java/Perl. And that's not even a problem, just a surprise for some people. I agree with the sentiment though; just hope that it doesn't apply to Ruby so far. Gavin