From: Philip Mak Date: 2002-07-02T07:36:31+09:00 Subject: Re: is this the way it should work? newbie problem... On Tue, Jul 02, 2002 at 07:30:23AM +0900, MIcha wrote: > that seems not to work: (it' ported from perl to ruby:-) > > x = max_x if --x == 0; > > the variable x is never decremented. > why? I believe the above code is semantically equivalent to this: if --x == 0 x = max_x end or this: if x - 1 == 0 x = max_x end The statement "x = max_x" overwrites the effect that "--x" had.