I did the clang blocks thing:<p><a href="https:&#x2F;&#x2F;mikeash.com&#x2F;pyblog&#x2F;friday-qa-2009-10-30-generators-in-objective-c.html" rel="nofollow">https:&#x2F;&#x2F;mikeash.com&#x2F;pyblog&#x2F;friday-qa-2009-10-30-generators-i...</a><p>I think it turned out pretty well, but I never used it in real code. The ability to avoid global state is great, anyway.