On Tue, Feb 16, 2010 at 7:30 PM, Seebs <usenet-nospam / seebs.net> wrote:

> On 2010-02-16, Xavier Noria <fxn / hashref.com> wrote:
>> On Tue, Feb 16, 2010 at 6:50 PM, Seebs <usenet-nospam / seebs.net> wrote:
>>> In practice it is, because when people say "x++", they don't want the variable
>>> x to refer to a new object, they want the object x refers to increased.
>
>> Don't agree with that. For me the contract is just about the variable.
>> People do not want to be able to do ++5, you can't do that in
>> languages that offer ++ either.
>
> In C:
>
> ++*p;
>
> Has nothing to do with the variable, has everything to do with the object
> denoted by the expression '*p'.
>
> In C, the variable denotes a region of storage. In Ruby, it doesn't.

You could argue that for += as well:

    *p += 1;

Does that C use case rule out += in Ruby? Nope we have our own +=
right? Same a posteriori for ++ in my opinion. It could be implemented
given the expectations that are reasonable to have in Ruby.