type Counter = object
limit: int
iterator count(c: Counter): int =
for i in 1 .. c.limit:
yield i
when isMainModule:
var ctr = Counter(limit: 5)
for i in ctr.count:
echo i
# I am looking for a way to call the object directly:
# for i in ctr: [...] instead of: for i in ctr.count: [...]