From: Tony Arcieri Date: 2010-02-17T05:10:05+09:00 Subject: Re: Why no ++ and --? --000e0cd3546eb38536047fbd5123 Content-Type: text/plain; charset=ISO-8859-1 On Tue, Feb 16, 2010 at 11:52 AM, Xavier Noria 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 --000e0cd3546eb38536047fbd5123--