Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Usually, I implement state machines with mutually tail recursive functions. Each function represents one state.


Right. 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).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: