2010-06-23 23:03:09 -05:00
|
|
|
|
2011-06-15 13:19:50 -05:00
|
|
|
|
|
|
|
|
|
|
|
// -*- rust -*-
|
2010-06-23 23:03:09 -05:00
|
|
|
fn main() {
|
2011-06-15 13:19:50 -05:00
|
|
|
let int sum = 0;
|
|
|
|
for each (int i in first_ten()) { log "main"; log i; sum = sum + i; }
|
|
|
|
log "sum";
|
|
|
|
log sum;
|
|
|
|
assert (sum == 45);
|
2010-06-23 23:03:09 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
iter first_ten() -> int {
|
2011-06-15 13:19:50 -05:00
|
|
|
let int i = 0;
|
|
|
|
while (i < 10) { log "first_ten"; put i; i = i + 1; }
|
|
|
|
}
|