#![allow(unused)]
fn main() {
// functions can be used before their definition
assert(foo(10, 20) == 60);
fn foo(mut x: int, mut y: int) -> int {
x += 10;
y += 20;
x + y
}
fn choose(cond: bool, a: int, b: int) -> int {
if cond {
return a;
}
b
}
assert_eq(choose(true, 1, 2), 1);
assert_eq(choose(false, 1, 2), 2);
}