2012-01-23 16:59:00 -06:00
|
|
|
fn test(f: fn(uint) -> uint) -> uint {
|
2012-08-01 19:30:05 -05:00
|
|
|
return f(22u);
|
2011-12-16 15:50:22 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2012-08-01 19:30:05 -05:00
|
|
|
let y = test(fn~(x: uint) -> uint { return 4u * x; });
|
2011-12-16 15:50:22 -06:00
|
|
|
assert y == 88u;
|
|
|
|
}
|