# here is a test program using two coroutines # I was going to write it in C++, but then would have to use pointers to member # functions, which are a mess, so I'll write it in C, and change to use "with" # later. # coro 1 joins lines together if they end in \ # coro 2 splits lines apart if they contain ; # (doesn't handle quoting) # need to have a "channels" idea use stdio.h struct process struct channel struct join_lines go(int to) switch to 0 go() int s = i + j int t = i * j printf("%d %d\n", s, t) int main() go() return 0