Skip to content

Instantly share code, notes, and snippets.

@vinibaggio
Created February 3, 2012 01:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vinibaggio/1727064 to your computer and use it in GitHub Desktop.
Save vinibaggio/1727064 to your computer and use it in GitHub Desktop.
closure example
bla = 1
# => 1
proc = -> { bla = bla + 1; bla }
# => #<Proc:0x007fb67b276b98@(irb):2 (lambda)>
bla = 5
# => 5
proc.()
# => 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment