Whaaaaat?

Jeremy H. wrote:

On 2009-05-14, Jeff M. [email protected] wrote:

1.9.1 adds Enumerable#reduce as synonym (which makes more sense to
me) and still retains inject

Is one of #reduce or #inject deprecated in 1.9.1?

Regards,

Jeremy H.

The RI entry has no preference or deprecation statement.

Regards,

jcm

On Fri, May 15, 2009 at 9:30 AM, Jeff S. [email protected]
wrote:

Is one of #reduce or #inject deprecated in 1.9.1?

Don’t think so.

Actually IMHO which makes more sense is situational.

Really? I never heard of “inject” in any other language. It was always
“reduce” to me. I got the impression that “inject” was just a cutesy way of
making the method name similar to detect, select, collect, and reject.

So did you stop reading my reply at that point?

And if you want to let languages vote on what the ‘correct’ name
should be maybe it should be fold:

Fold gets 8 ‘votes’,
Reduce gets 7, but that’s counting ruby’s afterthought, and Python
twice since it changed slightly between Python 2.x and 3.x so maybe
that should only be 5 ‘votes’
Inject gets ‘votes’ from Smalltalk and Ruby

Either reduce or inject is probably the earliest though. Probably
reduce since that’s what Common Lisp uses, BUT CL is a tad newer than
Smalltalk, and I’m not sure where in Lisp’s long evolution from Lisp
1.5 reduce came into common usage. I’m a bit perturbed that I can’t
seem to find my copy of the Lisp 1.5 Programmers Manual which is
probably buried somewhere in my attic.


Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

On Sat, May 16, 2009 at 12:20:03AM +0900, Jeff S. wrote:

Rick DeNatale wrote:

maybe it should be fold:

When I’ve seen “fold” it has meant something completely different,
despite what Wikipedia says. I’m not claiming right or wrong here, just
relating my own experience. There’s no need for you to take offense,
nor to reply with such an arrogant and condescending tone.

I didn’t see any arrogance or condescension. Where did you see it?

On Fri, May 15, 2009 at 11:37 AM, Chad P. [email protected]
wrote:

On Sat, May 16, 2009 at 12:20:03AM +0900, Jeff S. wrote:

Rick DeNatale wrote:

Something.

There’s no need for you to take offense,
nor to reply with such an arrogant and condescending tone.

I didn’t see any arrogance or condescension. Where did you see it?

Certainly, with all humility, none was intended.


Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale

Rick DeNatale wrote:

Actually IMHO which makes more sense is situational.
Really? I never heard of “inject” in any other language. It was always
“reduce” to me. I got the impression that “inject” was just a cutesy way of
making the method name similar to detect, select, collect, and reject.

So did you stop reading my reply at that point?

No, but I did somehow have a brain fart. Apologies.

And if you want to let languages vote on what the ‘correct’ name
should be

It’s not a question of correctness. Both inject and reduce are clearly
correct in their own context. It’s purely a matter of clarity.

maybe it should be fold:

When I’ve seen “fold” it has meant something completely different,
despite what Wikipedia says. I’m not claiming right or wrong here, just
relating my own experience. There’s no need for you to take offense,
nor to reply with such an arrogant and condescending tone.

Rick DeNatale wrote:

On Fri, May 15, 2009 at 11:37 AM, Chad P. [email protected] wrote:

On Sat, May 16, 2009 at 12:20:03AM +0900, Jeff S. wrote:

Rick DeNatale wrote:

Something.

There’s no need for you to take offense,
nor to reply with such an arrogant and condescending tone.
I didn’t see any arrogance or condescension. Where did you see it?

I said, effectively, “that terminology is new to me.” The
interpretation was apparently “you’re making that up,” and the response
was “you’re wrong, and I’ll prove it.”

Certainly, with all humility, none was intended.

My mistake.