2010-06-23 23:03:09 -05:00
|
|
|
// -*- rust -*-
|
|
|
|
|
|
|
|
fn ho(fn(int) -> int f) -> int {
|
|
|
|
let int n = f(3);
|
|
|
|
ret n;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn direct(int x) -> int {
|
|
|
|
ret x + 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let int a = direct(3); // direct
|
|
|
|
//let int b = ho(direct); // indirect unbound
|
|
|
|
let int c = ho(bind direct(_)); // indirect bound
|
2011-05-02 19:47:24 -05:00
|
|
|
//assert (a == b);
|
|
|
|
//assert (b == c);
|
2010-06-23 23:03:09 -05:00
|
|
|
}
|
|
|
|
|