Hi guys! I made a Generators library!, loosely like JavaScript generators.
How it works:
Creates a new generator. GENERATOR representing it.
Yields the generator. The second value is captured by NEXT VALUE.
Finishes a generator function.
Reports the next value from a generator, given by YIELD.
Reports if the generator is done.
Counter item(2) probably should be set at yield but tested at next value.
Or maybe it should be used as a semaphore to synchronize yield/next as they must work in strict cooperation - exactly one next for every yield.