2011-10-10 18:19:01 -07:00
|
|
|
// This is what the signature to spawn should look like with bare functions
|
|
|
|
|
2012-09-07 14:52:28 -07:00
|
|
|
fn spawn<T: Send>(val: T, f: extern fn(T)) {
|
2011-10-10 18:19:01 -07:00
|
|
|
f(val);
|
|
|
|
}
|
|
|
|
|
2012-09-19 13:59:44 -07:00
|
|
|
fn f(+i: int) {
|
2011-10-10 18:19:01 -07:00
|
|
|
assert i == 100;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
spawn(100, f);
|
2012-09-18 15:52:21 -07:00
|
|
|
}
|