From: Jason Persampieri Date: 2002-11-26T13:15:31+09:00 Subject: Re: Things That Newcomers to Ruby Should Know (11/24/02) > You're not changing the letter 'a' itself; you're > changing a string > which has the letter 'a' in it. > > To put it another way: > > You can have more than one "a" string: > > s = "a" > t = "a" > > and if you change or increment s: > > s.succ! # s is now "b" > > t doesn't change. > > But there's only one of each number. If you were > allowed to do > > 3.succ! > > or > > 3 += 1 > > then when you did this: > > puts 3 * 5 > > the output would be "20", because you would have > incremented the > actual object 3. > > > David > > -- > David Alan Black > home: dblack@candle.superlink.net > work: blackdav@shu.edu > Web: http://pirate.shu.edu/~blackdav So wouldn't it make send to have a somewhat global .succ! method and only allow the programmer to increment (++) on those that have it? I mean, C doesn't allow 3++ either (well, it may ALLOW it, but it doesn't mean anything). I think that argument is pretty bogus. Jason Persampieri Programmer Kush Games