From: Roger Pack Date: 2010-09-09T00:39:36+09:00 Subject: [ruby-core:32151] Re: Ruby 2.0 Wiki/Wish-list? > |++x and x++ > I have already rejected this idea many times. > > But just for curiosity, how do you define the semantics of x++ and > ++x, where you don't have explicit type for variables in Ruby. > For x += 1, it's easily defined as x = x + 1, but not that easy for > x++ and ++x. ++x is (y = x; x=x+1; y) (y is anonymous--basically just a return value) x++ is (x = x+ 1) as noted. I think that's how C does it. -r