Ruby ++, the one element and generators

Agree. That’s why I labelled my previous post as a Gedankenexperiment.
The point is showing that any attempt to introduce ‘++’ in Ruby in a
somewhat consistent way complicates it far more than some would think
at first. And that the returns are very small. I hoped the reader would
(in case (s)he read it all) realize by the end of that post that ‘++’ is
just not worth that much effort.

Just for the record, I do not want to have ‘++’ in Ruby, period.
But it’s always interesting to wonder ‘what if?’ cause this makes the
reasons behind matz’s decisions explicit. And proves that he was right :slight_smile:

···

On Mon, Dec 02, 2002 at 11:13:22AM +0900, Hal E. Fulton wrote:

----- Original Message -----
From: “Austin Ziegler” austin@halostatue.ca
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Sunday, December 01, 2002 5:52 PM
Subject: Re: Ruby ++, the one element and generators

[snip]

It would be nicer to be able to do Inc(a) or a++, but the cost – to
the Ruby language, IMO – of doing such a thing isn’t worth the
minor savings of keyboarding.

To me, ++ has a HUGE downside: it’s an assignment masquerading as an
increment. There is nothing for the novice which suggests that a++
is actually assigning as well as incrementing, unlike a += 1.

[snip again]

Austin –

This echoes my thoughts on the matter. Well said.

At any rate, it’s all rather a theoretical discussion –
i.e., it is moot, since I don’t expect Matz ever to add
++ to Ruby.

It’s fine to discuss matters of “why” and “what if” – but
IMO, he made right decision nine years ago, I’d be amazed
if he ever reversed it, and that is that.


_ _

__ __ | | ___ _ __ ___ __ _ _ __
'_ \ / | __/ __| '_ _ \ / ` | ’ \
) | (| | |
__ \ | | | | | (| | | | |
.__/ _,
|_|/| || ||_,|| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

Linux is not user-friendly.
It is user-friendly. It is not ignorant-friendly and idiot-friendly.
– Seen somewhere on the net