Skip to content

Instantly share code, notes, and snippets.

@onionhammer
Created June 18, 2013 22:21
Show Gist options
  • Save onionhammer/5809996 to your computer and use it in GitHub Desktop.
Save onionhammer/5809996 to your computer and use it in GitHub Desktop.
iterator testIter: int {.closure.} =
for i in 0..5:
yield i
for r in testIter():
echo r
#outputs: 0
iterator testIter: int =
for i in 0..5:
yield i
for r in testIter():
echo r
#outputs: 0 1 2 3 4 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment