Last active
December 18, 2015 03:38
-
-
Save bblum/5719126 to your computer and use it in GitHub Desktop.
returning a stack closure
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
| fn foo<'a>(blk: &fn(bar: &'a fn() -> &'a fn())) { | |
| let x = 5; | |
| let bar: &fn() = || { io::println(fmt!("%d", x)); }; | |
| do blk || { bar }; | |
| } | |
| fn main() { | |
| do foo |bar| { bar()(); } | |
| } |
nikomatsakis
commented
Jun 7, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment