Skip to content

Instantly share code, notes, and snippets.

@nowelium
Created October 9, 2010 14:27
Show Gist options
  • Save nowelium/618229 to your computer and use it in GitHub Desktop.
Save nowelium/618229 to your computer and use it in GitHub Desktop.
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