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.
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?
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.
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.”