diff options
author | Andreas Rumpf <andreasrumpf@noname> | 2009-09-15 23:22:22 +0200 |
---|---|---|
committer | Andreas Rumpf <andreasrumpf@noname> | 2009-09-15 23:22:22 +0200 |
commit | 66a7e3d37c0303997a6b1a3b7ec263dfb8c07748 (patch) | |
tree | 40ae1ab8aeb9086b7310ea73ab8a2ed6b597f88b /tests/titer3.nim | |
parent | 300430fbba28b408f7ac86ca46b03d9d50839399 (diff) | |
download | Nim-66a7e3d37c0303997a6b1a3b7ec263dfb8c07748.tar.gz |
added tools and web dirs
Diffstat (limited to 'tests/titer3.nim')
-rwxr-xr-x[-rw-r--r--] | tests/titer3.nim | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/titer3.nim b/tests/titer3.nim index b42113241..d0e121445 100644..100755 --- a/tests/titer3.nim +++ b/tests/titer3.nim @@ -1,7 +1,17 @@ + +iterator count1_3: int = + yield 1 + yield 2 + yield 3 + +for x in count1_3(): + write(stdout, $x) + # yield inside an iterator, but not in a loop: iterator iter1(a: openArray[int]): int = - yield a[0] #ERROR_MSG 'yield' only allowed in a loop of an iterator + yield a[0] var x = [[1, 2, 3], [4, 5, 6]] for y in iter1(x[0]): write(stdout, $y) +#OUT 1231 \ No newline at end of file |