Skip to content

Instantly share code, notes, and snippets.

@Varriount
Last active December 27, 2015 15:39
Show Gist options
  • Select an option

  • Save Varriount/7348747 to your computer and use it in GitHub Desktop.

Select an option

Save Varriount/7348747 to your computer and use it in GitHub Desktop.
iterator sillyOne(x, y:int): int {.closure.} =
var z = x
while z < y:
yield z
inc(z)
when defined(isMainModule):
var x = sillyOne
echo(x(1, 20))
echo(x(1, 21))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment