diff options
Diffstat (limited to 'tests/dll/nimhcr_0_4.nim')
-rw-r--r-- | tests/dll/nimhcr_0_4.nim | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/dll/nimhcr_0_4.nim b/tests/dll/nimhcr_0_4.nim new file mode 100644 index 000000000..4471782a7 --- /dev/null +++ b/tests/dll/nimhcr_0_4.nim @@ -0,0 +1,19 @@ + +import hotcodereloading + +import nimhcr_1 # only importing 1 + +let g_0 = 1000 # new value! but also a "new" global :) + +proc getInt*(): int = return g_0 + +proc makeCounter*(): auto = + return iterator: int {.closure.} = + for i in countup(0, 10, 1): + yield i + +let c = makeCounter() + +afterCodeReload: + echo " 0: after - closure iterator! after reload! does it remember? :", c() + echo " 0: after - closure iterator! after reload! does it remember? :", c() |