2012-08-20 18:53:33 -05:00
|
|
|
fn region_identity(x: &r/uint) -> &r/uint { x }
|
2012-04-01 16:28:30 -05:00
|
|
|
|
|
|
|
fn apply<T>(t: T, f: fn(T) -> T) -> T { f(t) }
|
|
|
|
|
|
|
|
fn parameterized(x: &uint) -> uint {
|
2012-06-26 15:55:56 -05:00
|
|
|
let z = apply(x, ({|y|
|
2012-04-01 16:28:30 -05:00
|
|
|
region_identity(y)
|
2012-06-26 15:55:56 -05:00
|
|
|
}));
|
2012-04-01 16:28:30 -05:00
|
|
|
*z
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = 3u;
|
|
|
|
assert parameterized(&x) == 3u;
|
|
|
|
}
|