From looking at the code, it looks like factors give input to states by setting fields in the state. This seems ugly and unnecessarily stateful, and the fact that the factors are nil-ed right in start after being checked suggests that they are not conceptually part of the state.
Why not pass factor parameters into the state as a parameter to start? It would remove the need for the factor = nil boilerplate and leave less room for error.
From looking at the code, it looks like factors give input to states by setting fields in the state. This seems ugly and unnecessarily stateful, and the fact that the factors are
nil-ed right instartafter being checked suggests that they are not conceptually part of the state.Why not pass factor parameters into the state as a parameter to
start? It would remove the need for thefactor = nilboilerplate and leave less room for error.