rust/src/test/run-pass/iter-range.rs
Marijn Haverbeke 3b5b93221e Remove some semicolons after block calls
The remaining ones can be removed after the next snapshot. (Or
we can let the next pretty-print pass take care of them.)
2011-10-21 14:24:42 +02:00

14 lines
207 B
Rust

fn range(a: int, b: int, it: block(int)) {
assert (a < b);
let i: int = a;
while i < b { it(i); i += 1; }
}
fn main() {
let sum: int = 0;
range(0, 100) {|x| sum += x; }
log sum;
}