[Newbies] Re: How to shorten a method (using inject: into: ?)

Randal L. Schwartz merlyn at stonehenge.com
Mon Jul 21 15:49:27 UTC 2008

>>>>> "Randal" == Randal L Schwartz <merlyn at stonehenge.com> writes:

Randal> Huh?  Why the heck is that called #detectSum: instead of just #sum:?


Randal> /me makes a note to look under #detectFoo: next time

In fact, now that I look at it, it's really not like #detectMax:, which
returns the *original* element that is the max, or #detect:, which returns
an *original* element that meets a test.  It's transformational, more
like #collect.  But since #sum already does that, it really should have
simply been named #sum:.


Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion

More information about the Beginners mailing list