On Tue, Feb 16, 2010 at 1:28 AM, lith <minilith / gmail.com> wrote:

> I find that issue interesting in a slightly different perspective.
> Shouldn't it be possible to implement that operator right in ruby and
> doesn't it point to a shortcoming that there is no way to implement it
> (other than using a decorator).
>

++ and -- modify their receivers.  Since Ruby's Numeric types are immutable,
they cannot be modified.  So the only solution is to implement ++ and -- as
assignment operators.

Immutability certainly isn't a shortcoming, in fact it's very much a good
thing, especially when concurrency is involved.  My own pet programming
language has no mutable state whatsoever and implements all operators that
modify their receivers as assignments.

-- 
Tony Arcieri
Medioh! A Kudelski Brand