Hi --

On Sat, 7 Nov 2009, Tony Arcieri wrote:

> On Thu, Nov 5, 2009 at 5:28 PM, David A. Black <dblack / rubypal.com> wrote:
>
>> The thing is, a method called ++ that did in-place incremention would not
>> be meaningful for
>> numbers (if I understand correctly that you mean it would be similar
>> to succ!), and having it for other objects would probably just lead to
>> more confusion. That's my hunch, at least.
>
>
> There's no point at all if it doesn't work on numbers.

It depends how you define "work" :-) I'll stick with my formulation,
though: in-place incrementation of a numeric is not meaningful. So if
++ is understood to be in-place incrementation (like succ!), which is
how I interpreted your earlier post, then it wouldn't be meaningful
for numbers.

> It would require special case behavior.  Application to literal numbers
> would be strange.  But there's certainly no reason it can't be done, and you
> have one Ruby implementer on this thread attesting that it can.

It seems like a lot of special-casing and strangeness, though. I'm a
little bit hampered in discussing it, I guess, because I don't see
what benefit it would confer in exchange for the anomaly. So I'm
probably going in circles.


David

-- 
The          Ruby training with D. Black, G. Brown, J.McAnally
Compleat     Jan 22-23, 2010, Tampa, FL
Rubyist      http://www.thecompleatrubyist.com

David A. Black/Ruby Power and Light, LLC (http://www.rubypal.com)