Skip to content

Instantly share code, notes, and snippets.

Created Aug 28, 2013
What would you like to do?
Simon Tatham/Tom Duff style coroutines
#define start(state) switch(state) { case 0:;
#define finish default:; }
/*save state and return value*/
#define yield(state,value) do { state = __LINE__; return (value); case __LINE__:; } while (0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment