From: Stefan Rusterholz Date: 2008-08-31T18:36:34+09:00 Subject: Re: Please don't flame me...why is there no "++" in Ruby aga John Pritchard-williams wrote: > There's must be very good simple reason why there is no 'x++' method > Ruby right? > > Just generally interested why there isn't.... > > I did check my Ruby books by the way, but they just "unlike C there is > no ++ operator in Ruby...." :) Many good answers already. I'd like to point out yet another reason why. Consider: for(i=0; i<100; i++) { loop_body } Here, i is incremented *after* the loop_body. Thus its name, post-increment. In ruby there is no way to tell a method to run not where it lexically is but after some action. You couldn't even identify after what action. After the next yield? After the next statement? Regards Stefan (apeiros) -- Posted via http://www.ruby-forum.com/.