Skip to content

Instantly share code, notes, and snippets.

@msullivan
Created August 16, 2012 22:11
Show Gist options
  • Select an option

  • Save msullivan/3374079 to your computer and use it in GitHub Desktop.

Select an option

Save msullivan/3374079 to your computer and use it in GitHub Desktop.
fn build<A>(builder: fn(push: fn(+A))) -> ~[A] {
let mut vec = ~[];
builder(|x| vec::push(vec, x));
return vec;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment