Created
January 9, 2015 22:55
-
-
Save XMPPwocky/8822ffe6e55b2328c79b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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