Skip to content

Instantly share code, notes, and snippets.

@echristopherson
Created May 17, 2011 01:53
Show Gist options
  • Save echristopherson/975747 to your computer and use it in GitHub Desktop.
Save echristopherson/975747 to your computer and use it in GitHub Desktop.
scope = 'local'
lam = lambda do
puts scope
inner_lam = lambda do
puts scope
end
inner_lam[]
end
lam[]
# output:
# local
# local
scope = 'global'
lam[]
# output:
# global
# global
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment