From: dblack@... Date: 2002-11-26T22:16:34+09:00 Subject: Re: Things That Newcomers to Ruby Should Know (11/24/02) Hi -- On Tue, 26 Nov 2002, Simon Cozens wrote: > "Gavin Sinclair" writes: > > > 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. > > What I'm saying is that proof-by-current-implementation isn't a great way > to argue the presence or absence of a feature. But proof-by-current-implementation-of-other-languages can't be any better.... > > 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. > > It may not even be a surprise. I don't think that most people would > care (or even notice) that a hypothetical foo.succ! gave them a > different object back from the one they started with. They definitely should care and notice. It isn't a matter of indifference in Ruby whether a variable refers to this or that object: a = "x" b = a a.extend(SomeModule) b.succ! b.some_method_from_Some_Module Having b.succ! perform a magical, hidden assignment to b (rather than an in-place incrementation of the object referred to by b) would be extremely anomalous. David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav