Skip to content

Instantly share code, notes, and snippets.

@barcharcraz
Created March 20, 2014 18:18
Show Gist options
  • Save barcharcraz/f5278b275a4d758d4685 to your computer and use it in GitHub Desktop.
Save barcharcraz/f5278b275a4d758d4685 to your computer and use it in GitHub Desktop.
iterator get1(typ1: typedesc): typ1 {.inline.} =
for i in 0..10:
yield 1.typ1
iterator get2(typ1: typedesc; typ2: typedesc): typ2 {.inline.} =
for elm in get1(typ1):
for i in 0..10:
yield (elm + 1).typ2
for elm in get2(int, float):
echo elm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment