2011-10-10 20:19:01 -05:00
|
|
|
// This is what the signature to spawn should look like with bare functions
|
|
|
|
|
2012-07-03 18:11:00 -05:00
|
|
|
fn spawn<T: send>(val: T, f: extern fn(T)) {
|
2011-10-10 20:19:01 -05:00
|
|
|
f(val);
|
|
|
|
}
|
|
|
|
|
2011-10-20 22:34:04 -05:00
|
|
|
fn f(&&i: int) {
|
2011-10-10 20:19:01 -05:00
|
|
|
assert i == 100;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
spawn(100, f);
|
|
|
|
}
|