2011-12-29 09:49:33 -08:00
|
|
|
fn main() {
|
2012-01-23 14:59:00 -08:00
|
|
|
fn f(i: fn() -> uint) -> uint { i() }
|
2012-06-25 20:00:46 -07:00
|
|
|
let v = [-1f, 0f, 1f, 2f, 3f]/~;
|
2011-12-29 09:49:33 -08:00
|
|
|
let z = vec::foldl(f, v) { |x, _y| x } { || 22u };
|
|
|
|
assert z == 22u;
|
|
|
|
}
|