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-07-27 07:19:39 -05:00
|
|
|
let sum: int = 0;
|
2011-12-22 19:53:53 -06:00
|
|
|
first_ten {|i| #debug("main"); log(debug, i); sum = sum + i; };
|
2011-12-22 16:42:52 -06:00
|
|
|
#debug("sum");
|
2011-12-22 19:53:53 -06:00
|
|
|
log(debug, sum);
|
2011-06-15 13:19:50 -05:00
|
|
|
assert (sum == 45);
|
2010-06-23 23:03:09 -05:00
|
|
|
}
|
|
|
|
|
2011-10-21 06:14:28 -05:00
|
|
|
fn first_ten(it: block(int)) {
|
2011-07-27 07:19:39 -05:00
|
|
|
let i: int = 0;
|
2011-12-22 16:42:52 -06:00
|
|
|
while i < 10 { #debug("first_ten"); it(i); i = i + 1; }
|
2011-08-15 23:54:52 -05:00
|
|
|
}
|