On Fri, May 15, 2009 at 7:25 AM, Jeremy Henty <onepoint@starurchin.org> wrote:
On 2009-05-14, Jeff Moore <jcmoore@pressenter.com> 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?
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.
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 Fri, May 15, 2009 at 9:30 AM, Jeff Schwab <jeff@schwabcenter.com> wrote:
Rick DeNatale wrote:
On Fri, May 15, 2009 at 7:25 AM, Jeremy Henty <onepoint@starurchin.org> >> wrote:
On 2009-05-14, Jeff Moore <jcmoore@pressenter.com> 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?
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.
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?
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?
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 Fri, May 15, 2009 at 9:30 AM, Jeff Schwab <jeff@schwabcenter.com> wrote:
On Fri, May 15, 2009 at 7:25 AM, Jeremy Henty <onepoint@starurchin.org> >>> wrote:
On 2009-05-14, Jeff Moore <jcmoore@pressenter.com> wrote:
I didn't see any arrogance or condescension. Where did you see it?
···
On Sat, May 16, 2009 at 12:20:03AM +0900, Jeff Schwab 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.
--
Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]
Quoth Reginald Braithwaite: "Nor is it as easy as piling more features
on regardless of how well they fit or whether people will actually use
them. Otherwise Windows would have 97% of the market and OS X 3%. (Oh
wait.)"
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.
···
On Fri, May 15, 2009 at 11:37 AM, Chad Perrin <perrin@apotheon.com> wrote:
On Sat, May 16, 2009 at 12:20:03AM +0900, Jeff Schwab wrote: