amodule.nim 325 B

12345678910111213141516171819202122
  1. # bug #14219
  2. var vectors = @["a", "b", "c", "d", "e"]
  3. iterator testVectors(): string =
  4. for vector in vectors:
  5. yield vector
  6. var r = ""
  7. for item in testVectors():
  8. r.add item
  9. echo r
  10. # bug #12990
  11. iterator test(): int {.closure.} =
  12. yield 0
  13. let x = test
  14. while true:
  15. let val = x()
  16. if finished(x): break
  17. echo val