fixes #271
This commit is contained in:
parent
c98696d742
commit
a22c1f444f
9 changed files with 54 additions and 38 deletions
|
|
@ -4,17 +4,17 @@ discard """
|
|||
0'''
|
||||
"""
|
||||
|
||||
iterator count(x: int, skip: bool): int {.closure.} =
|
||||
iterator count[T](x: T, skip: bool): int {.closure.} =
|
||||
if skip: return x+10
|
||||
else: yield x+1
|
||||
|
||||
if skip: return x+10
|
||||
else: yield x+2
|
||||
|
||||
proc takeProc(x: iterator (x: int, skip: bool): int) =
|
||||
proc takeProc[T](x: iterator (x: T, skip: bool): int) =
|
||||
echo x(4, false)
|
||||
echo x(4, true)
|
||||
echo x(4, false)
|
||||
|
||||
takeProc(count)
|
||||
takeProc(count[int])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue