From: dblack@... Date: 2007-01-13T04:32:21+09:00 Subject: Re: RCR again (Integer#succ!, Integer#pred!) Hi -- On Sat, 13 Jan 2007, Robert Dober wrote: > I am definitely in an RCR mood ;) > > Well as I was reading the archives and Jim Weirich's guidlines I saw an > accepted RCR for Integer#odd? Integer#even? > I always define Integer#pred for myself it seems so trivial that I did not > bother the list *on purpose* > I filed the RCR right away. > Sorry for breaking the rule it seemed appropriate. > > But I was considering a second RCR and this one does by no means allow not > to consult the community. > > I would also like to have > Integer#pred! and Integer#succ! doing the "obvious" of course. > > x = 41 > x.succ! => 42 > x => 42 > > What do you think ? I don't consider that obvious at all. Integers are immutable, and variables aren't objects -- so it doesn't fit the model. That's also why Matz has never put x++ in the language. David -- Q. What is THE Ruby book for Rails developers? A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black) (See what readers are saying! http://www.rubypal.com/r4rrevs.pdf) Q. Where can I get Ruby/Rails on-site training, consulting, coaching? A. Ruby Power and Light, LLC (http://www.rubypal.com)