rust/src/test/run-pass/iter-range.rs
2011-07-27 15:54:33 +02:00

13 lines
216 B
Rust

iter range(a: int, b: int) -> int {
assert (a < b);
let i: int = a;
while i < b { put i; i += 1; }
}
fn main() {
let sum: int = 0;
for each x: int in range(0, 100) { sum += x; }
log sum;
}