3 ms·
Usually, I implement state machines with mutually tail recursive functions. Each function represents one state.
by lysium 9y ago
Usually, I implement state machines with mutually tail recursive functions. Each function represents one state.
- e12e 9y agoRight. The general rewrite would be a loop with a switch and state functions that returned a state? (i was going to say state functions that called back to a step function, but I guess that'd still build a call stack).