Skip to content

Instantly share code, notes, and snippets.

@timlinquist
Created April 21, 2011 16:31
Show Gist options
  • Select an option

  • Save timlinquist/934929 to your computer and use it in GitHub Desktop.

Select an option

Save timlinquist/934929 to your computer and use it in GitHub Desktop.
Block with local scope
my_big_array = (0..10000000000000).to_a
object= some_object.new do
#Do some stuff
#Save block for later use
end
#Block holds a reference to my_big_array until it goes away
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment