nimhcr_0_3.nim 414 B

1234567891011121314151617181920
  1. import hotcodereloading
  2. import nimhcr_1
  3. import nimhcr_2 # a new and different import!
  4. proc makeCounter*(): auto =
  5. return iterator: int {.closure.} =
  6. for i in countup(0, 10, 1):
  7. yield i
  8. let c = makeCounter()
  9. afterCodeReload:
  10. echo " 0: after - closure iterator: ", c()
  11. echo " 0: after - closure iterator: ", c()
  12. echo " 0: after - c_2 = ", c_2
  13. proc getInt*(): int = return g_1 + g_2.len