Skip to content

Commit

Permalink
Add iterator (#572)
Browse files Browse the repository at this point in the history
  • Loading branch information
demotomohiro authored Feb 18, 2025
1 parent 4ef710d commit 16d5387
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/std/system.nim
Original file line number Diff line number Diff line change
Expand Up @@ -475,3 +475,5 @@ template len*[I, T](x: array[I, T]): int =
include "system/setops"

include "system/stringimpl"

include "system/iterators"
5 changes: 5 additions & 0 deletions lib/std/system/iterators.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
iterator `..<`*(a, b: int): int {.inline.} =
var i = a
while i < b:
yield i
inc i

0 comments on commit 16d5387

Please sign in to comment.