iter
std › iter
Stepped ranges of integers, for @for.
from std.iter import range
macro countdown() {
@for i in range(10, 0, -3) {
@emit i
}
}
countdown
10 7 4 1
Macros
range
A Range from start to stop, not including stop, every step.
| Syntax | Parameters | Result | Description |
|---|---|---|---|
range start, stop, step | start: int, stop: int, step: int = 1 |
Types
Range
struct Range<const start: int, const stop: int, const step: int>
The integers from start up to (or down to) stop, not including it,
every step. range builds one. step can’t be 0, and has to point from
start towards stop.
Some of its fields are generated by @for or @if.