Nice, thank you.
Updated example for the completeness:
iterator foo(): int =
var a = init()
try:
while a.hasNext():
yield a.nextValue()
finally:
a.cleanup()
Run
Nice, thank you.
Updated example for the completeness:
iterator foo(): int =
var a = init()
try:
while a.hasNext():
yield a.nextValue()
finally:
a.cleanup()
Run