Skip to content

Instantly share code, notes, and snippets.

@XMPPwocky
Created January 9, 2015 22:55
Show Gist options
  • Save XMPPwocky/8822ffe6e55b2328c79b to your computer and use it in GitHub Desktop.
Save XMPPwocky/8822ffe6e55b2328c79b to your computer and use it in GitHub Desktop.
extern crate arena;
#[derive(Show)]
enum Node<'a> {
Cons(u32, &'a Node<'a>),
Nil
}
fn main() {
let a = arena::TypedArena::new();
let n1 = a.alloc(Node::Nil);
let n2 = a.alloc(Node::Cons(42, n1));
println!("{:?}", n2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment