2011-10-11 21:03:23 -05:00
|
|
|
fn even(&&e: int) -> bool {
|
|
|
|
e % 2 == 0
|
|
|
|
}
|
|
|
|
|
2012-01-11 11:58:05 -06:00
|
|
|
fn log_if<T>(c: native fn(T)->bool, e: T) {
|
2011-12-22 19:53:53 -06:00
|
|
|
if c(e) { log(debug, e); }
|
2011-10-11 21:03:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2012-02-07 08:37:08 -06:00
|
|
|
(log_if(even, _))(2);
|
2011-10-11 21:03:23 -05:00
|
|
|
}
|