Guest User

Nim countup example

a guest
Jun 30th, 2016
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nim 0.14 KB | None | 0 0
  1. iterator countupn*[T, S](a: T, b: S, step = 1): T {.inline.} =
  2.   var res = int(a)
  3.   while res <= int(b):
  4.     yield T(res)
  5.     inc(res)
Advertisement
Add Comment
Please, Sign In to add comment