Created
October 9, 2010 14:27
-
-
Save nowelium/618229 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
closures := List clone | |
for(i, 1, 5, | |
localvar := "foo" .. i | |
closures append(block(localvar)) | |
) | |
closures foreach(b, b call println) | |
// ==> foo5 | |
// ==> foo5 | |
// ==> foo5 | |
// ==> foo5 | |
// ==> foo5 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment