mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 08:54:53 +00:00
14 lines
286 B
Nim
14 lines
286 B
Nim
block:
|
|
iterator `[]`(a: int, r: int): int =
|
|
for q in 0 .. r:
|
|
yield a
|
|
|
|
for val in 10[2]: discard
|
|
|
|
type Custom = distinct string
|
|
|
|
iterator `[]`(a: Custom, r: int): char =
|
|
for q in 0 .. r:
|
|
yield a.string[q]
|
|
|
|
for val in Custom("test")[2]: discard |