Created
June 18, 2013 22:21
-
-
Save onionhammer/5809996 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iterator testIter: int {.closure.} = | |
for i in 0..5: | |
yield i | |
for r in testIter(): | |
echo r | |
#outputs: 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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