top level closures should work; transf is not a pass anymore; next steps for first class iterator support
This commit is contained in:
parent
f686647f58
commit
244c14db0b
17 changed files with 293 additions and 229 deletions
|
|
@ -1,3 +1 @@
|
|||
import utemplates
|
||||
|
||||
# uclosures
|
||||
import utemplates, uclosures
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ test "loop variables are captured by copy":
|
|||
var funcs: seq[proc (): int {.closure.}] = @[]
|
||||
|
||||
for i in 0..10:
|
||||
funcs.add do -> int: return i * i
|
||||
let ii = i
|
||||
funcs.add do -> int: return ii * ii
|
||||
|
||||
check funcs[0]() == 0
|
||||
check funcs[3]() == 9
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue