On Tue, Feb 16, 2010 at 11:52 AM, Xavier Noria <fxn / hashref.com> wrote:

> 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.
>

And += can result in a sequence of message exchanges as well:

obj.meth += 1
obj[member] += 1

These will need to invoke the respective getters and setters for obj, in
addition to invoking '+' on the object returned from the getter.

In that regard += is very much sugar for:

obj.meth = obj.meth + 1

-- 
Tony Arcieri
Medioh! A Kudelski Brand