Last active
December 27, 2015 15:39
-
-
Save Varriount/7348835 to your computer and use it in GitHub Desktop.
This file contains 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 sillyOne(y:string): int {.closure.} = | |
var x = "" | |
while true: | |
x = x & y | |
yield x | |
when defined(isMainModule): | |
var x = sillyOne | |
echo(x("Hello")) | |
echo(x(" World")) | |
echo(x("!")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment