tarrayiter.nim 286 B

1234567891011121314
  1. block:
  2. iterator `[]`(a: int, r: int): int =
  3. for q in 0 .. r:
  4. yield a
  5. for val in 10[2]: discard
  6. type Custom = distinct string
  7. iterator `[]`(a: Custom, r: int): char =
  8. for q in 0 .. r:
  9. yield a.string[q]
  10. for val in Custom("test")[2]: discard