use std; import std::comm; import std::comm::chan; import std::comm::send; fn main() { test05(); } type pair = { a: A, b: B }; fn make_generic_record(a: A, b: B) -> pair { ret {a: a, b: b}; } fn test05_start(&&f: sendfn(&&float, &&str) -> pair) { let p = f(22.22f, "Hi"); log(debug, p); assert p.a == 22.22f; assert p.b == "Hi"; let q = f(44.44f, "Ho"); log(debug, q); assert q.a == 44.44f; assert q.b == "Ho"; } fn spawn(f: fn(sendfn(A,B)->pair)) { let arg = sendfn(a: A, b: B) -> pair { ret make_generic_record(a, b); }; task::spawn(arg, f); } fn test05() { spawn::(test05_start); }