Skip to content

Instantly share code, notes, and snippets.

@Blei
Created October 9, 2012 17:27
Show Gist options
  • Save Blei/3860196 to your computer and use it in GitHub Desktop.
Save Blei/3860196 to your computer and use it in GitHub Desktop.
enum FOO {
Foo(fn@())
}
fn bar() {
io::println("baz");
}
fn main() {
let f = Foo(bar);
for (~[1, 2, 3]).each |_i| {
match f {
Foo(my_fn) => my_fn()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment