From: Marnen Laibow-Koser Date: 2009-11-09T20:36:47+09:00 Subject: Re: Ruby doesn't implement x++ for Fixnum's because ??? Tony Arcieri wrote: [...] >> But the deeper problem in ruby is what do pre- and post- really mean? > > > Really? Well, that's certainly one of the issues. [...] >> It's not an answer to say >> >> 'x++' should have the same effect as 'x+=1' >> >> because that's not even true in C. > > > Correct, it's ++x that would have the same effect as x += 1, not that I > find > the preincrementation vs postincrementation distinction particularly > useful > in Ruby, The "step through subscripts" use of ++ and -- is not useful in Ruby because of the use of iterators. The pre-/postincrement distinction is not that useful because of the nature of the language. So...why have ++ and -- at all if its two main advantages are not useful in Ruby? Where's the benefit? What is some actual Ruby code that would be improved by these constructs? > which is why I've advocated picking the canonical one There is no one canonical one. Pre and post are both canonical, and that's the problem. > and going > with that, even though preincrementation has semantics which would make > more > sense in Ruby. Um, what? > > I'm trying to be pragmatic... What's pragmatic about grafting onto Ruby a feature which is useful in C but not in Ruby? Again, if you can think of an actual context where this would be useful in Ruby, please provide actual code. > and yet being dismissed out of hand. You're not being dismissed out of hand. You've been given numerous reasons why this is not a great idea, which it seems that you keep on ignoring. > Because > it is not Ruby-like! According to certain people's definitions of > "Ruby-like"... The fact that it would require major parser and language changes is a pretty good indication that it is not in keeping with the nature of the language... Best, -- Marnen Laibow-Koser http://www.marnen.org marnen@marnen.org -- Posted via http://www.ruby-forum.com/.