"cdrick" == cdrick cdrick65@gmail.com 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]) sum.
Well, the #detectSum: solution is even cleaner. :)
mTotal := testSets detectSum: [:each | each maternalCount].
It's just a horribly named method, which is why I didn't find it at first.