While browsing for something, I can't recall what, I found a page on coroutines in C by a guy named Simon Tatham. The implementation uses funky macros and gotos to get things working. Ouch, that could really be offensive to some people.
Then there's the infamous "Duff's Device", which was mentioned in Bjarne Stroustrup's The C++ Programming Language book. The reason it came up in relation to coroutines is that it does indeed use the switch structure as a screwy means of goto.
Well, everyone should just give up and use state machines.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment