Skip to content

Instantly share code, notes, and snippets.

@Varriount
Last active December 27, 2015 15:39
Show Gist options
  • Save Varriount/7348835 to your computer and use it in GitHub Desktop.
Save Varriount/7348835 to your computer and use it in GitHub Desktop.
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