From: MikkelFJ Date: 2002-12-01T08:20:35+09:00 Subject: Re: Ruby ++, the one element and generators "MikkelFJ" wrote in message news:3de9424e$0$47426$edfadb0f@dtext01.news.tele.dk... > To be exactly like C, if you'd like to have both ++x and x++ operators, you > can choose the following path: > > x = 5 > y = x + x.next # y == 6 > # x == 6 sorry, should read x = 5 y = (x = x.next) # y == 6 # x == 6 the post inc. versions is ok: > > x = 5 > y = (tmp = x; x = x.next; tmp) # y == 5 > # x == 6 Mikkel