Skip to content

Instantly share code, notes, and snippets.

@darkone23
Last active January 3, 2016 07:08
Show Gist options
  • Save darkone23/8427001 to your computer and use it in GitHub Desktop.
Save darkone23/8427001 to your computer and use it in GitHub Desktop.
fn gen_closure(x: int) -> proc(int) -> int {
return proc(y: int) { x * y };
}
fn main() {
println!("{}", gen_closure(2)(3))
}
// 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment