From: Dave Bass Date: 2008-08-29T20:27:01+09:00 Subject: Re: Please don't flame me...why is there no "++" in Ruby again ? John Pritchard-williams wrote: > There's must be very good simple reason why there is no 'x++' method > Ruby right? The problem with the ++ operator, and similar operators, is that the side effects can be unpredictable. Kernighan and Ritchie, 2nd ed., have this to say: "In any expression involving side effects, there can be subtle dependencies on the order in which variables taking part in the expression are updated. One unhappy situation is typified by the statement a[i] = i++; The question is whether the subscript is the old value of i or the new. Compilers can interpret this in different ways, and generate different answers depending on their interpretation." In Ruby there's only one compiler (no formal language definition, just a single implementation), unlike C. But there's still the point that the semantics of the statement may be unclear to the programmer. Dave -- Posted via http://www.ruby-forum.com/.