2010-06-23 23:03:09 -05:00
|
|
|
type tupbox[T] = tup(@T);
|
|
|
|
type recbox[T] = rec(@T x);
|
|
|
|
|
2010-10-28 17:02:00 -05:00
|
|
|
fn tuplift[T](&T t) -> tupbox[T] { ret tup(@t); }
|
|
|
|
fn reclift[T](&T t) -> recbox[T] { ret rec(x=@t); }
|
2010-06-23 23:03:09 -05:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let int foo = 17;
|
|
|
|
let tupbox[int] tbfoo = tuplift[int](foo);
|
|
|
|
let recbox[int] rbfoo = reclift[int](foo);
|
|
|
|
check (tbfoo._0 == foo);
|
|
|
|
check (rbfoo.x == foo);
|
|
|
|
}
|