Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template repeat*(times: static[Natural], body: untyped): untyped =
- ## Repeat a body N times.
- ##
- ## I saw it first in Kotlin.
- runnableExamples:
- var cnt = 0
- repeat(5):
- inc cnt
- doAssert cnt == 5
- for _ in 0 ..< times:
- body
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement