Skip to content

Instantly share code, notes, and snippets.

@coolaj86
Created August 15, 2012 21:06
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 coolaj86/3363690 to your computer and use it in GitHub Desktop.
Save coolaj86/3363690 to your computer and use it in GitHub Desktop.
Weird Scope in Luvit / Lua
local msg = "hello"
local coolness = function ()
local foo = "bar"
print(msg)
print(foo)
return foo
end
local function daAwesome()
local baz = coolness()
print(foo)
end
doAwesome()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment