summaryrefslogtreecommitdiffstats
path: root/examples/20_list.rs
blob: a8b7e6f7ef482220d1c2c9523fd83f367aba8c5f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
extern crate debug;

enum List<T> {
    Cons(T, Box<List<T>>),
    Nil
}

fn main () {
    let l = box Cons(1i, box Cons(2i, box Cons(4i, box Nil)));
    println!("{:?}", l);
}