Hacker News new | past | comments | ask | show | jobs | submit login

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




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: