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:
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])
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
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 -
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 |
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