Hi Stan,
How about using #detectSum:?
testMaleMeiosis2 pTotal := Forecaster testMale meiose detectSum: [:strand | strand testRun paternalCount]. mTotal := Forecaster testMale meiose detectSum: [:strand | strand testRun maternalCount]. self should: [mTotal = 100 and: [pTotal = 100]]
Other methods of this variety include #detectMin:, #detectMax: and #count: and possibly others.
Regards, Zulq.
stan shepherd wrote:
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 | testSet := strand testRun. mCount := testSet maternalCount. pCount := testSet paternalCount. mTotal := mTotal + mCount. pTotal := pTotal + pCount]. self should: [mTotal = 100 and: [pTotal = 100]]
I'm trying to shorten it, including various attempts with inject: into: , but with no success. Any tips please?
....Stan