Skip to content

Instantly share code, notes, and snippets.

@dacc
Created May 18, 2010 02:32
Show Gist options
  • Save dacc/404530 to your computer and use it in GitHub Desktop.
Save dacc/404530 to your computer and use it in GitHub Desktop.
ruby-1.9.1-p378 > i = 2
=> 2
ruby-1.9.1-p378 > i = 3
=> 3
ruby-1.9.1-p378 > p = proc {i = 2; proc {i}}.call
=> #<Proc:0x000001008dc398@(irb):3>
ruby-1.9.1-p378 > p.call
=> 2
ruby-1.9.1-p378 > i = 4
=> 4
ruby-1.9.1-p378 > p.call
=> 4
ruby-1.9.1-p378 >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment