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