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

2008-07-22 Thread cdrick
Zulq Alam-2 wrote: Using #inject:into and Point objects to store the totals: testMaleMeiosis4 | totals | totals := Forecaster testMale meiose inject: [EMAIL PROTECTED] into: [:subtotals :strand | subtotals + (strand maternalCount @ strand maternalCount)]. self should:

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

2008-07-22 Thread Randal L. Schwartz
cdrick == cdrick [EMAIL PROTECTED] writes: cdrick Always choose the most readable (before optimizing) and to me, the cdrick following is much more readable: cdrick mTotal := (testSets collect: [:each | each maternalCount]) sum. cdrick pTotal := (testSets collect: [:each | each paternalCount])

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

2008-07-22 Thread K. K. Subramaniam
On Tuesday 22 Jul 2008 9:54:25 pm Randal L. Schwartz wrote: It's just a horribly named method, which is why I didn't find it at first. Message Finder is quite handy for exploring selectors in an image. Entering sum in a new line in workspace or text object and then pressing ALT+SHIFT+W would

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

2008-07-22 Thread Randal L. Schwartz
K == K K Subramaniam [EMAIL PROTECTED] writes: K Entering sum in a new line in workspace or text object and then pressing K ALT+SHIFT+W would have revealed detectSum: (it is eleventh in my list). Yeah, I looked near the implementation of #sum instead. Ooops. -- Randal L. Schwartz -

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

2008-07-21 Thread cdrick
Hi Stan, 2008/7/21 stan shepherd [EMAIL PROTECTED]: Hi, I have the following method, that code critics flags as long: testMaleMeiosis2 | testSet mCount pCount mTotal pTotal | pTotal := 0. mTotal := 0. Forecaster testMale meiose do: [:strand |

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

2008-07-21 Thread stan shepherd
Quoting cdrick [EMAIL PROTECTED]: testMaleMeiosis2 | resultArray tesSet | testSet := strand testRun. resultArray := Forecaster testMale meiose inject: #(0 0) into: [:array :val | array at: 1 put: (array at: 1) + testSet maternalCount. array at: 2