2012-01-23 16:59:00 -06:00
|
|
|
fn force(f: fn() -> int) -> int { ret f(); }
|
2011-07-25 18:57:27 -05:00
|
|
|
fn main() {
|
2012-01-11 11:58:05 -06:00
|
|
|
fn f() -> int { ret 7; }
|
2011-07-27 07:19:39 -05:00
|
|
|
assert (force(f) == 7);
|
2012-06-19 21:34:01 -05:00
|
|
|
let g = {||force(f)};
|
2011-07-27 07:19:39 -05:00
|
|
|
assert (g() == 7);
|
2011-08-19 17:16:48 -05:00
|
|
|
}
|